CoreDNS is a DNS server that chains plugins
open sourceApache-2.0self-hostablefree
CoreDNS is a fast, flexible DNS server and forwarder written in Go, built from a chain of plugins configured in a short Corefile. It's the default cluster DNS in Kubernetes, answering service and pod names through its kubernetes plugin, and it equally serves zone files, acts as a primary or secondary (AXFR) server, forwards and caches queries, signs zones with DNSSEC on the fly, rewrites queries and serves records from etcd, AWS Route 53, Azure DNS or Google Cloud DNS. It listens on plain DNS, DNS over TLS, DNS over HTTPS (HTTP/2 and HTTP/3), DNS over QUIC and gRPC, exports Prometheus metrics, and can be compiled with extra out-of-tree plugins. It's an Apache-2.0 CNCF graduated project.
Ways to install
On your own server
On Kubernetes
Package managers
Problems it solves
- pods in our Kubernetes cluster can't resolve service names and we need to fix cluster DNS
- forward internal domains to one DNS server and everything else to Cloudflare or Google from the cluster
- a lightweight DNS server we configure with a few lines instead of BIND's zone files and named.conf
- serve DNS for our own zone from a zone file and act as a secondary for another server
- run a DNS over TLS or DNS over HTTPS resolver endpoint for our network
- rewrite DNS queries so an old hostname resolves to a new service
- service discovery over DNS from records stored in etcd
- answer DNS queries from our AWS Route 53, Azure DNS or Google Cloud DNS zones locally
- add Prometheus metrics and query logging to our DNS server
- sign DNS answers with DNSSEC on the fly without a separate signing pipeline
- build a custom DNS server by writing a small Go plugin instead of patching a big daemon
Features
- plugin chain configured in a Corefile; build with the plugins you need
- kubernetes plugin: the default implementation of Kubernetes cluster DNS
- UDP/TCP DNS, DNS over TLS (RFC 7858), DNS over HTTP/2 and HTTP/3, DNS over QUIC (RFC 9250) and gRPC
- serves zone files (file, auto), primary with zone transfers, secondary over AXFR
- forward to upstream resolvers over DNS or gRPC, with a response cache
- on-the-fly DNSSEC signing
- etcd backend (SkyDNS-style) and route53, azure and clouddns plugins
- rewrite and template plugins for queries and answers
- hosts file records, load balancing of answers, DNS64, NSID and ANY blocking
- Prometheus metrics, query and error logging, pprof
View 1 more
- out-of-tree plugins and a guide to writing your own
Limitations
- Doesn't do incremental zone transfers (IXFR) as a secondary: it retrieves zones from primaries with AXFR only5
- No NSEC3 for DNSSEC zones served from files: CoreDNS supports NSEC only5
Capabilities
| Takes plugins | plan not known |
|---|
Alternatives
The same job
These do what CoreDNS does.
- BIND 9 Versatile, classic, complete name server software
- Technitium DNS Server Self host a DNS server for privacy & security
- NSD Open-source authoritative DNS server from NLnet Labs
- PowerDNS Authoritative Server A high-performance and versatile authoritative DNS server
- Knot DNS High-performance authoritative-only DNS server
- Knot Resolver Full caching DNS resolver implementation
