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.
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
Every option is a command line flag or the environment variable next to it.
| Flag | Variable | Default | Meaning |
|---|---|---|---|
--docker | DOCKER_HOST | /var/run/docker.sock | Path to the Docker socket, or a tcp:// address |
--domain | DOMAIN | docker | Base domain the container names are registered under |
--record | RECORDS | A static record as name:ip or name:[ipv6], repeated or comma separated | |
--dns-bind | DNS_BIND | 0.0.0.0:53 | Address the DNS server binds |
--timeout | timeout | 30 | Docker request timeout in seconds, over tcp:// only |
--cacert | CA | CA certificate that verifies the Docker daemon | |
--client-key, --client-cert | CLIENT_KEY, CLIENT_CERT | Client credentials for mutual TLS, both or neither |
MIT, see LICENSE
SPDX-License-Identifier: MIT
Content type
Image
Digest
sha256:51116f5e5…
Size
5.4 MB
Last updated
4 days ago
docker pull kristofmattei/docker-dns-rs