Where Does CoreDNS Store Its Config?
CoreDNS reads a Corefile from the working dir (or -conf path). Docker mounts it at /etc/coredns; Kubernetes embeds it in a ConfigMap.
Last updated
CoreDNS configures through a single file conventionally named Corefile: zone blocks chaining plugins for forwarding, caching, logging, metrics, and errors. Bare binaries read ./Corefile from the working directory unless -conf points elsewhere. Docker images conventionally mount it at /etc/coredns/Corefile with ports 53 TCP/UDP published.
Kubernetes embeds the same file in the coredns ConfigMap in kube-system, which is why cluster DNS edits happen via kubectl rather than files. The import plugin splits large configs across files; back those up with the root Corefile or restores fail on missing includes. Reload gracefully with SIGUSR1 after edits instead of restarting and dropping in-flight queries.
Where CoreDNS stores this, by platform
Corefile (working dir) or /etc/coredns/Corefile
Zone blocks and plugin chains. Bare runs read cwd; pass -conf explicitly. import statements pull sibling files, so copy the whole config dir, not one file. Reload with SIGUSR1.
Frequently asked questions
how do i migrate coredns to a new server
Copy the Corefile (plus imported zone files and snippets) to the new host and start with the same -conf path. Validate with coredns -conf Corefile on a high port plus dig before cutting over port 53.
why does coredns answer with my own address
The compiled-in fallback: a whoami plus log server. It answers queries with your own address, which looks like resolution working while answering nothing. Always pass an explicit Corefile; never rely on the default in production.
Notice an outdated path? Let us know.