CoreDNS — Flexible DNS Server Written in Go
CoreDNS is a CNCF-graduated DNS server written in Go, composed entirely of plugins, and used as the default in-cluster DNS for Kubernetes since v1.13.
What it is
CoreDNS is a DNS server written in Go that uses a plugin architecture for all its functionality. Every feature, from caching to logging to Kubernetes service discovery, is a plugin that can be enabled or disabled. CoreDNS is a CNCF-graduated project and has been the default in-cluster DNS provider for Kubernetes since version 1.13.
Cluster administrators, DevOps engineers, and anyone running Kubernetes benefit from understanding CoreDNS since it handles all internal DNS resolution in their clusters. It also serves as a general-purpose DNS server for non-Kubernetes use cases.
How it saves time or tokens
CoreDNS replaces complex DNS configurations with a declarative Corefile format. Instead of managing BIND zone files or dnsmasq configurations, you declare your DNS behavior in a simple, readable format. The plugin architecture means you add only the features you need, keeping the server lightweight and its configuration minimal.
How to use
- Download the CoreDNS binary or use it as the default DNS in your Kubernetes cluster
- Write a Corefile specifying zones and plugins
- Start CoreDNS with
coredns -conf Corefile
Example
# Corefile example
.:53 {
forward . 8.8.8.8 8.8.4.4
cache 30
log
errors
}
example.com:53 {
file db.example.com
log
}
# Download and run
curl -LO https://github.com/coredns/coredns/releases/latest/download/coredns_linux_amd64.tgz
tar xzf coredns_linux_amd64.tgz
./coredns -conf Corefile
Related on TokRepo
- DevOps tools — Explore infrastructure and networking tools
- Self-hosted tools — Browse self-hosted network services
Common pitfalls
- Plugin order in the Corefile matters; some plugins must come before others for correct behavior
- Kubernetes CoreDNS ConfigMap changes require a pod restart to take effect; not all changes are picked up automatically
- Misconfigured forward plugins can create DNS loops; always use upstream resolvers, not the server itself
Frequently Asked Questions
CoreDNS replaced kube-dns as the default because its plugin architecture is more flexible, easier to configure, and more performant. The Kubernetes plugin automatically discovers services and pods for DNS resolution.
Yes. CoreDNS is a general-purpose DNS server. You can use it as an authoritative DNS server, a recursive resolver, a caching proxy, or any combination. It works independently of Kubernetes.
Edit the CoreDNS ConfigMap in the kube-system namespace. Changes to the Corefile require restarting the CoreDNS pods. You can add custom zones, forwarding rules, and plugins through the ConfigMap.
The Corefile is CoreDNS configuration file. It defines DNS zones and the plugins applied to each zone. The format is declarative: you specify the zone, then list plugins with their settings inside curly braces.
Yes. CoreDNS supports DNS over TLS (DoT) and DNS over HTTPS (DoH) through the tls and doh plugins. This encrypts DNS queries between clients and the server, preventing eavesdropping on DNS traffic.
Citations (3)
- CoreDNS GitHub— CNCF-graduated DNS server with plugin architecture
- Kubernetes Documentation— Default Kubernetes in-cluster DNS since v1.13
- CoreDNS Documentation— Plugin-based architecture with Corefile configuration
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.