CoreDNS
CoreDNS is a flexible DNS server written in Go, commonly used as the cluster DNS for Kubernetes. It resolves service names to pod IPs through a plugin-based architecture that can also handle forwarding, caching, and custom record sources.
itCloud native tools and technologies | OpenSkills.info
Intro
CoreDNS
CoreDNS is a DNS server built around plugins. DNS turns names into records that software can use. CoreDNS receives a DNS query, routes it through a configured plugin chain, and returns a DNS response.
That plugin model is the main idea. One plugin can read Kubernetes service data. Another can serve a zone file. Others can forward queries, cache responses, expose metrics, or report health. You assemble the DNS behavior you need instead of adopting one fixed server role.
CoreDNS is widely encountered as the DNS service inside Kubernetes. The Kubernetes plugin watches cluster data and answers service-discovery queries. Queries outside the cluster domain can pass to the forward plugin and then to upstream resolvers. CoreDNS also works outside Kubernetes as a forwarding server or an authoritative server backed by files and other data sources.
The mental model
Think in three layers:
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://coredns.io/
Supports
- CoreDNS as a plugin-based DNS server
- Representative plugin functions including Kubernetes service discovery, metrics, rewriting, and zone-file serving
- https://coredns.io/manual/toc/
Supports
- CoreDNS architecture, installation, server selection, server blocks, Corefiles, and plugin chains
- Most functionality supplied by plugins and plugins compiled into the binary
- Most-specific zone matching and plugin processing outcomes
- Plugin execution order defined by plugin.cfg rather than Corefile directive order
- Root-zone and port syntax, environment substitution, imports, and snippets
- Authoritative zone-file and forwarding setups
- Default distribution without a native recursive resolver plugin
- https://coredns.io/plugins/
Supports
- Canonical catalog of CoreDNS plugin documentation
- https://coredns.io/plugins/kubernetes/
Supports
- Kubernetes plugin reads zone data and implements Kubernetes DNS-based service discovery
- Service and endpoint behavior, namespace selection, fallthrough, time to live, and multicluster options
- Startup synchronization, SERVFAIL before synchronization, and readiness reporting
- Forward plugin use for stub domains and upstream nameservers
- https://coredns.io/plugins/forward/
Supports
- Forwarding syntax, upstream selection, connection reuse, transports, in-band health checks, and metrics
- Forwarding all names through resolvers listed in /etc/resolv.conf
- https://coredns.io/plugins/cache/
Supports
- Response caching, positive and denial caches, capacity, time-to-live behavior, prefetch, serve-stale behavior, and metrics
- https://coredns.io/plugins/errors/
Supports
- Processing-error logging and error consolidation
- https://coredns.io/plugins/log/
Supports
- Query logging to standard output, response classes, customizable formats, and performance cost on busy servers
- https://coredns.io/plugins/health/
Supports
- Process health endpoint and liveness meaning
- https://coredns.io/plugins/ready/
Supports
- Readiness aggregation, default endpoint, response codes, and monitoring modes
- https://coredns.io/plugins/metrics/
Supports
- Prometheus endpoint and CoreDNS request, duration, size, response, build, and panic metrics
- https://coredns.io/plugins/reload/
Supports
- Automatic Corefile reload, jitter, reload metrics, and retention of the old configuration after parse failure
- https://coredns.io/plugins/loop/
Supports
- Startup detection of simple static forwarding loops
- Kubernetes forwarding loops involving host resolver configuration
- Detection limits after the startup probe succeeds
- https://coredns.io/2017/07/25/compile-time-enabling-or-disabling-plugins/
Supports
- Plugins enabled or disabled at compile time through plugin.cfg
- Listing compiled plugins with the plugins command-line flag
- https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
Supports
- Normal and headless Service records
- Service name structure, namespaces, search domains, Pod DNS policies, and external forwarding under ClusterFirst
- https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/
Supports
- Kubernetes DNS add-on behavior
- Default CoreDNS Corefile and supported cluster DNS customization
