CoreDNS
A fast, flexible DNS server written in Go with a plugin-based architecture — the default DNS server in Kubernetes and a CNCF graduated project.
Plugin-Based DNS for Cloud Native
CoreDNS is built around a plugin chain — every DNS function is implemented as a plugin, and you compose a server by listing plugins in a Corefile. This makes CoreDNS extremely flexible: the same binary can act as an authoritative server, a forwarder, a caching resolver, or all three simultaneously on different ports.
Kubernetes uses CoreDNS as its in-cluster DNS service. Every Pod's DNS queries go through CoreDNS, which resolves Kubernetes Service names (service.namespace.svc.cluster.local) and forwards external queries upstream. Understanding CoreDNS configuration is essential for Kubernetes DNS troubleshooting.
- Single Go binary — easy to deploy in containers, no external dependencies
- Plugin chain:
cache,forward,hosts,file,kubernetes,etcd, and 30+ more - Kubernetes plugin reads Service and Pod records directly from the API server
- Prometheus metrics plugin for monitoring DNS query rates and latency
- Health check endpoints (
healthplugin) for load balancer integration - DNS-over-TLS and DNS-over-HTTPS via
tlsplugin - Reload plugin for zero-downtime config changes
- You are running Kubernetes (it's already there)
- You need a lightweight containerized DNS server
- You want plugin composability over monolithic config
- You need etcd-backed dynamic DNS records
Corefile Examples
Default Kubernetes Corefile
Forwarder + caching server
Split-horizon with file plugin
Troubleshoot K8s DNS
Related Topics
DNSSEC-validating recursive resolver — a more traditional alternative for non-Kubernetes environments.
dnsmasqLightweight DNS forwarder often used in the same small-network and container contexts as CoreDNS.
Recursive ResolverLearn how recursive resolvers work — CoreDNS can act as one with the forward plugin.