A CoreDNS plugin that serves DNS records for containers running on the local Docker daemon.
Install from a published release on the GitHub releases page:
# Linux amd64 — pick the binary that matches your platform/arch
curl -fsSL -o coredns-docker \
https://github.com/dokku/coredns-docker/releases/latest/download/coredns-docker-linux-amd64
chmod +x coredns-docker
sudo mv coredns-docker /usr/local/bin/Or build a single binary from source (requires Go):
make build-localThis produces ./coredns-docker-local in the repository root. See docs/installation.md for Debian packages, cross-platform builds, and the Docker image.
Create a minimal Corefile that serves the docker. zone on port 1053:
docker:1053 {
docker {
zone docker.
}
}
Start CoreDNS with that Corefile:
coredns-docker -conf CorefileStart any Docker container and query it by name:
docker run -d --name web nginx
dig @127.0.0.1 -p 1053 web.docker +short
# → 172.17.0.2The plugin watches Docker events, so starting, stopping, or restarting containers updates the available names with no need to restart CoreDNS.
- Getting Started -- install, first Corefile, first query
- Installation -- release binaries, Debian packages, source builds, and Docker image
- DNS Basics -- a short primer on zones, A/AAAA, SRV, TXT, CNAME, PTR records, and TTLs
- Configuration -- every Corefile option, stale mode, reverse zones, and the synthetic SOA/NS
- Docker Labels -- hostname, cname, txt, srv, and wildcard labels
- Metrics -- every Prometheus metric the plugin exposes
- Testing -- unit, integration, and end-to-end test targets
- Linux with systemd -- route
docker.queries viasystemd-resolvedand run CoreDNS as a service - macOS with /etc/resolver -- route
docker.queries via the macOS resolver - Examples -- runnable
docker compose+Corefilesetups for every feature