Sign inSign up

kristofmattei/docker-dns-rs

By kristofmattei

•Updated about 15 hours ago

Image
Networking
0

10K+

kristofmattei/docker-dns-rs repository overview

⁠docker-dns-rs

Rewrite of https://github.com/phensley/docker-dns⁠ in Rust.

Code uses hickory-dns⁠ as the DNS library, hyper-unix-socket⁠ to talk to Docker over a Unix socket and Tokio to be the Socket glue.

⁠Running

docker run \
    --detach \
    --name docker-dns-rs \
    --restart unless-stopped \
    --publish 53:53/udp \
    --publish 53:53/tcp \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    ghcr.io/kristof-mattei/docker-dns-rs:latest

The same as a compose service:

services:
  docker-dns-rs:
    image: ghcr.io/kristof-mattei/docker-dns-rs:latest
    restart: unless-stopped
    ports:
      - "53:53/udp"
      - "53:53/tcp"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

⁠Configuration

Every option is a command line flag or the environment variable next to it.

FlagVariableDefaultMeaning
--dockerDOCKER_HOST/var/run/docker.sockPath to the Docker socket, or a tcp:// address
--domainDOMAINdockerBase domain the container names are registered under
--recordRECORDSA static record as name:ip or name:[ipv6], repeated or comma separated
--dns-bindDNS_BIND0.0.0.0:53Address the DNS server binds
--timeouttimeout30Docker request timeout in seconds, over tcp:// only
--cacertCACA certificate that verifies the Docker daemon
--client-key, --client-certCLIENT_KEY, CLIENT_CERTClient credentials for mutual TLS, both or neither

⁠License

MIT, see LICENSE⁠

SPDX-License-Identifier: MIT

Tag summary

Content type

Image

Digest

sha256:51116f5e5…

Size

5.4 MB

Last updated

4 days ago

docker pull kristofmattei/docker-dns-rs