How CoreDNS Works: Explained Simply

CoreDNS is one of those quiet heroes in your Kubernetes cluster. It doesn’t get much attention—until DNS stops working, and suddenly everything breaks. Let’s understand how it works — simply. What Is CoreDNS? CoreDNS is the default DNS server in Kubernetes. It’s what helps your pods resolve names like my-service.default.svc.cluster.local to an actual IP address. It’s not just a DNS server. It’s modular, pluggable, and built for cloud-native environments. Why Is DNS Needed in Kubernetes? In Kubernetes, everything is dynamic: ...

July 19, 2025 · 2 min · 281 words · John Cena

How to Add a Custom DNS Zone in CoreDNS (Kubernetes)

Why Add a Custom DNS Zone? Adding a custom DNS zone in CoreDNS can be useful for: Internal testing (e.g., *.local or *.internal) Service discovery for non-Kubernetes services Custom mappings and overrides Step-by-Step Guide 1. Edit the CoreDNS ConfigMap kubectl -n kube-system edit configmap coredns Add a new zone block like this: apiVersion: v1 kind: ConfigMap metadata: name: coredns namespace: kube-system data: Corefile: | .:53 { errors health kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } forward . /etc/resolv.conf cache 30 loop reload loadbalance } internal.test:53 { hosts { 10.10.10.10 service1.internal.test 10.10.10.11 service2.internal.test fallthrough } } 2. Restart CoreDNS kubectl -n kube-system rollout restart deployment coredns 3. Test the Zone From any pod: ...

July 19, 2025 · 1 min · 199 words · John Cena

How to Add a Custom DNS Zone in NodeLocal DNSCache

Why Use Custom DNS Zones in NodeLocal DNSCache? NodeLocal DNSCache speeds up DNS resolution in Kubernetes by running a local CoreDNS instance on each node. Adding custom zones allows: Fast resolution of static or internal domains DNS overrides without relying on upstream resolvers Separation of internal and external DNS logic Step-by-Step Guide 1. Get the NodeLocal DNS ConfigMap kubectl -n kube-system get configmap node-local-dns -o yaml > node-local-dns.yaml 2. Add Custom Zones Inside the Corefile section, add your custom zone using the hosts plugin: ...

July 19, 2025 · 2 min · 222 words · John Cena

What is NodeLocalDNS and How It Works

What is NodeLocalDNS? NodeLocalDNS is an optional feature in Kubernetes that improves DNS performance and reliability by running a small DNS caching server on each node. Instead of making every DNS request go across the network to the kube-dns or CoreDNS service, the request is handled locally on the node. This reduces DNS lookup latency and avoids overloading the shared cluster DNS service. Why Use NodeLocalDNS? 🧠 Faster DNS resolution — queries are resolved from local cache. 📉 Reduced load on kube-dns/CoreDNS — fewer round trips to the central service. 🌐 Better reliability — even if CoreDNS has a hiccup, cached results can still resolve. How NodeLocalDNS Works Here’s a simplified flow: ...

July 19, 2025 · 2 min · 288 words · John Cena