Introduction

At 20:41 the checkout service starts throwing intermittent timeouts, and every error names a different downstream host. One request cannot resolve a payment API, the next cannot resolve an internal inventory Service, and a third succeeds after a retry as if nothing happened. The Pods are Running, the nodes look idle, and restarting CoreDNS appears to help for a few days. That pattern is the classic opening symptom for Kubernetes DNS troubleshooting, because a resolver that is fully down fails every lookup, while a resolver path with a race, a search-domain multiplier or a capacity edge fails only some lookups, on some nodes, under some timing.

Treat that composite incident as a timing problem first and a configuration problem second. If failures cluster at almost exactly five seconds, or at multiples of five seconds, you are probably looking at a resolver timeout rather than an application bug. If the same name fails instantly with NXDOMAIN, the answer is different. If CoreDNS logs show SERVFAIL while its Pods restart, the answer is different again. Good Kubernetes DNS troubleshooting therefore starts by classifying the failure shape: how long it takes, which names it affects, whether retries pass, and whether the fault follows a Pod, a node or the whole cluster.

This guide walks the path a lookup actually travels: the stub resolver inside the container, the kube-dns ClusterIP and its DNAT rules, the CoreDNS plugin chain, the upstream resolver, and the return path through connection tracking. Along the way it covers the ndots:5 tax, the glibc conntrack race behind the five-second stall, CoreDNS throttling and OOM kills, wrong-namespace short names, and the fixes that hold up in production. The aim is a repeatable on-call sequence, not a pile of restarts.


1. Kubernetes DNS troubleshooting: time the failure before you touch CoreDNS

The fastest Kubernetes DNS troubleshooting step is a stopwatch, not a restart. Run lookups from a debug Pod in the same namespace as the failing workload, because namespace changes the search domains and NetworkPolicy changes the path. The kubernetes.io dnsutils pattern is still the cleanest probe: a small Pod you can exec into, with nslookup or dig available, sitting where the application sits. Time short names, fully qualified names and an external name, and record whether each attempt is instant, slow-but-successful, or stuck at a timeout boundary.

bash
kubectl -n payments run dnsutils --restart=Never \
  --image=registry.k8s.io/e2e-test-images/agnhost:2.39
kubectl -n payments exec -it dnsutils -- nslookup postgres
kubectl -n payments exec -it dnsutils -- nslookup postgres.payments.svc.cluster.local
kubectl -n payments exec -it dnsutils -- nslookup kubernetes.default
kubectl -n payments exec -it dnsutils -- cat /etc/resolv.conf

Read the timings like a triage nurse. A fully qualified in-cluster name that resolves in two milliseconds while the short name fails points at search domains or namespace assumptions. An external name that takes 5,000 milliseconds and then succeeds on retry points at a dropped UDP response or a conntrack race. Nothing resolving, including kubernetes.default, points at CoreDNS, its endpoints or the path to the ClusterIP. Intermittent SERVFAIL with rising CoreDNS latency points at capacity, upstream trouble or a plugin error. Each shape sends you to a different layer, which is why guessing wastes the first hour of the incident.

Also capture where the failure lives. Run the same probe from a second namespace and, if you can, from a Pod pinned to a different node. DNS faults that follow one node suggest conntrack pressure, kube-proxy rules or a sick NodeLocal cache on that node. Faults that follow one namespace suggest NetworkPolicy or a bad dnsConfig. Faults everywhere suggest CoreDNS or its upstream. Write those three coordinates down — name, timing, location — before you change anything. If the probe shows the kube-dns Service itself has no backends, switch to the Service has no endpoints runbook first, because DNS cannot answer through an empty EndpointSlice.


2. Kubernetes DNS troubleshooting map: stub resolver, ClusterIP, CoreDNS and upstream

A useful Kubernetes DNS troubleshooting map has five hops, and each hop leaves a different fingerprint. Hop one is the stub resolver in the container: glibc, musl or a language runtime reading /etc/resolv.conf, which kubelet generated with the cluster DNS ClusterIP, a search list and options ndots:5. Hop two is the ClusterIP itself, a virtual IP translated by iptables or IPVS rules into a CoreDNS Pod IP. Hop three is CoreDNS, running a plugin chain from its Corefile: typically kubernetes for cluster names, cache for repeat lookups, forward for everything else, plus health, ready and prometheus. Hop four is the upstream resolver CoreDNS forwards to, often the node resolver or a cloud VPC resolver. Hop five is the return path, where connection tracking must match the UDP reply to the waiting socket.

Failures announce their hop if you listen. A wrong search list fails only short names. A broken DNAT path fails everything and CoreDNS logs stay silent because packets never arrive. A CoreDNS plugin problem produces SERVFAIL or REFUSED in the logs, with the query visible. An upstream problem produces timeouts in the forward plugin while cluster names still resolve. A return-path problem produces the maddening case where CoreDNS answered correctly and the client still waited five seconds.

Check the CoreDNS side with the same discipline you would use for any Service: Pods ready, endpoints populated, logs clean, metrics moving. The Kubernetes Services guide explains how ClusterIP and headless Services differ, which matters here because kube-dns is a normal ClusterIP Service whose backends are CoreDNS Pods.

bash
kubectl -n kube-system get pods -l k8s-app=kube-dns -o wide
kubectl -n kube-system get endpointslice -l kubernetes.io/service-name=kube-dns
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=100
kubectl -n kube-system get configmap coredns -o yaml

Look for restart counts climbing, OOMKilled terminations, CPU throttling on the CoreDNS containers, and Corefile edits that never rolled out. CoreDNS usually runs two replicas by default in small clusters, which is fine until a few hundred Pods start amplifying lookups through ndots. Scaling CoreDNS fixes a capacity fault; it does nothing for a resolver race, and restarting it merely resets counters you should have been reading. That distinction is the spine of this whole runbook.


3. Kubernetes DNS troubleshooting for ndots:5 and search-domain amplification

The ndots setting is the quiet multiplier behind much Kubernetes DNS troubleshooting. Kubelet writes options ndots:5 into every Pod's resolv.conf, which means any name with fewer than five dots is treated as relative and tried against each search domain before the name is tried as written. For an in-cluster short name like postgres, the first expansion, postgres.payments.svc.cluster.local, usually hits immediately and nobody notices the mechanism. For an external name like api.stripe.com, which has two dots, the resolver first asks for api.stripe.com.payments.svc.cluster.local, then api.stripe.com.svc.cluster.local, then api.stripe.com.cluster.local, and only then api.stripe.com itself.

Count the packets, because the packets are the point. Three wasted expansions plus the real query make four lookups for one logical resolution. If the resolver asks for both A and AAAA records, that becomes eight UDP packets for a single getaddrinfo call. Each packet crosses the CNI, hits a CoreDNS Pod, and walks the plugin chain. The wasted queries are cheap individually, but they multiply CoreDNS load, fill conntrack tables faster, and give rare packet-loss races many more chances to fire. A workload resolving external APIs on every request can generate an order of magnitude more DNS traffic than its request rate suggests.

The fix depends on what the workload actually resolves. Services that mostly call external hostnames can set ndots to 1 in dnsConfig, so a name with at least one dot is tried as absolute first. Services that call in-cluster names should prefer fully qualified names with a trailing dot, such as postgres.payments.svc.cluster.local., which skips search expansion entirely. Platform teams sometimes lower ndots cluster-wide through kubelet configuration, but that changes behaviour for every tenant and deserves a staged rollout. The CNI guide is worth reading alongside this, because the packet path your amplified queries travel is the same dataplane the CNI programs.

yaml
spec:
  dnsConfig:
    options:
      - name: ndots
        value: "1"
      - name: single-request-reopen

Verify the change from inside the Pod, not from the manifest. Cat /etc/resolv.conf after the rollout and confirm the options line changed, then re-time the external lookup that used to stall. If the lookup count drops but the five-second stalls remain, ndots was an amplifier, not the root cause, and the next section is where your incident lives.


4. Kubernetes DNS troubleshooting for the five-second conntrack stall

The five-second stall is the signature fault in Kubernetes DNS troubleshooting, and it is neither a CoreDNS bug nor a Kubernetes bug. It lives in the interaction between glibc, UDP and Linux connection tracking. When glibc resolves a name, it typically sends the A and AAAA queries in parallel from the same socket, which means the same source port. Both packets head for the kube-dns ClusterIP, and DNAT rewrites the destination to a CoreDNS Pod IP. Two nearly identical UDP flows now race to create conntrack entries, and under load the kernel can drop one packet when the insert collides. The dropped query is never answered, the resolver waits out its five-second timeout, retries, and succeeds. From the application side, a 30 millisecond request becomes a 5,030 millisecond request with no error in any server log.

That mechanism explains the incident shape from the introduction: intermittent, retry-friendly, node-dependent, and temporarily hidden by a CoreDNS restart that does nothing to the kernel race. It also explains why ndots matters so much. Eight packets per lookup means eight chances to lose the race, so a workload with heavy external resolution hits a rare kernel collision often enough to page someone. Fixing only ndots reduces the rate; fixing the race removes the class.

There are three practical countermeasures, and they stack. First, add single-request-reopen to dnsConfig for glibc-based images, which forces the resolver to use a fresh socket per query and removes the same-port collision. Second, lower ndots so fewer packets race. Third, deploy NodeLocal DNSCache, which runs a DNS cache on every node and lets Pods query a node-local address, bypassing the ClusterIP DNAT and its conntrack path for most lookups. NodeLocal DNSCache is the strongest fix at scale, and it also cuts CoreDNS load because repeat lookups are answered locally. It is ignored by nobody and helped by everyone, but it is a platform change, so stage it node pool by node pool.

Musl-based images, such as Alpine, behave differently: they do not honour single-request-reopen, and their resolver behaviour has its own quirks with search domains and parallel queries. If your failing workload is Alpine-based, skip the glibc options and go straight to NodeLocal DNSCache or fully qualified names. Check the image before you copy a dnsConfig snippet from a blog post, including this one. The container networking troubleshooting guide covers the wider packet-path checks, including conntrack table pressure, that pair well with this section.

Prove the fix with timing, not vibes. Run a loop of timed lookups from the workload's namespace before and after the change, and look for the disappearance of the 5,000 millisecond cluster in the results. A fix that merely makes stalls rarer will still show occasional five-second outliers; a fix that removes the race will not.


5. Kubernetes DNS troubleshooting when CoreDNS returns SERVFAIL or REFUSED

SERVFAIL and REFUSED move Kubernetes DNS troubleshooting from the kernel back into CoreDNS itself. SERVFAIL means CoreDNS tried and failed: an upstream timeout, a plugin error, or a loop detected by the loop plugin. REFUSED usually means CoreDNS is not authoritative for that zone or a plugin rejected the query, which happens when a stub domain points at the wrong server or a custom Corefile block is malformed. Both are visible in CoreDNS logs, which is good news: the packets arrived, so your problem is configuration, capacity or upstream health rather than the dataplane.

Start with the boring checks that solve real incidents. Are the CoreDNS Pods actually ready, or is one crash-looping on a bad Corefile edit? Is a CoreDNS container being OOMKilled because the cache plugin is sized for a small cluster? Is CPU throttling stretching query latency until clients time out and retry, doubling the load? The CoreDNS deployment in many clusters ships with modest resource requests, and a cluster that grew from fifty Pods to five hundred can outgrow them without anyone noticing until DNS becomes the bottleneck.

bash
kubectl -n kube-system describe pod -l k8s-app=kube-dns | grep -A5 -i "last state"
kubectl -n kube-system top pods -l k8s-app=kube-dns
kubectl -n kube-system logs -l k8s-app=kube-dns --tail=200 | grep -i "error\|servfail\|loop"

Then read the Corefile as code, because it is code. The forward plugin's upstream list decides where external names go; a stale upstream IP after a VPC change produces SERVFAIL for external names while cluster names keep working. The cache plugin's TTL settings decide how long negative answers stick around, which matters after you fix a missing Service and clients keep hearing NXDOMAIN from cache. The kubernetes plugin's fallthrough settings decide whether a name that misses in the cluster zone gets forwarded or answered with NXDOMAIN. Each of those is a one-line change with cluster-wide blast radius, so edit the ConfigMap through GitOps, not by hand at 2 a.m.

Capacity deserves a number, not a guess. CoreDNS exposes Prometheus metrics on port 9153 when the prometheus plugin is enabled: query rate, response codes, cache hit ratio and request duration. Alert on SERVFAIL rate and p99 duration, and scale replicas or raise resources when duration climbs with query rate. If CoreDNS is healthy and fast while clients still stall, believe the metrics and go back to the resolver path; the kubectl master guide has the command patterns for pulling this evidence quickly during an incident.


6. Troubleshooting matrix: match the Kubernetes DNS troubleshooting symptom to the layer

A matrix earns its place in Kubernetes DNS troubleshooting because the same user-visible symptom — "DNS is flaky" — has at least six different causes with six different fixes. Work down the symptom column until the timing and evidence match your incident, then apply only that row's fix and re-measure. Changing two layers at once destroys your ability to say what worked, which matters when the incident review asks why the fix should be trusted.

Symptom Timing / evidence Layer First fix
External lookups stall, retries pass Failures cluster at 5.00s or 10.00s; CoreDNS logs clean glibc + conntrack race single-request-reopen, lower ndots, NodeLocal DNSCache
External lookups slow but succeed 3 wasted NXDOMAIN expansions before the real answer ndots:5 search amplification ndots 1 in dnsConfig or FQDN with trailing dot
Short name fails, FQDN works Instant NXDOMAIN for postgres, success for full name Search domains / namespace Fix namespace or use FQDN; check resolv.conf
Everything fails, CoreDNS silent No queries in CoreDNS logs; endpoints empty or policy drop ClusterIP path / NetworkPolicy Check EndpointSlices, kube-proxy, port 53 policy
SERVFAIL in logs Upstream timeouts, plugin errors, restarts climbing CoreDNS config / capacity / upstream Fix Corefile, scale CoreDNS, repair upstream
NXDOMAIN for a real Service Service exists but has no ready endpoints Service / readiness Fix selector or probes; see no-endpoints runbook
Stalls on one node only Same Pod spec healthy elsewhere; conntrack table full Node dataplane Drain node, check conntrack, NodeLocal cache health

Notice how few rows end with "restart CoreDNS". A restart can clear a wedged process or a poisoned cache, but it also destroys the restart counters, cache state and latency history you need for diagnosis. If a restart appears to fix the incident, treat that as evidence of a resource or race fault, capture metrics first, and schedule the real fix while the cluster is calm.

Keep the matrix honest by attaching evidence to each row you rule out. "Not conntrack, because failures are instant NXDOMAIN" is a finding. "Not CoreDNS capacity, because p99 duration is 3 ms during the incident" is a finding. An incident timeline built from ruled-out rows is what separates a senior runbook from a lucky guess, and it is exactly what interviewers probe when they ask how you debug DNS.


7. Kubernetes DNS troubleshooting for NXDOMAIN, wrong namespace and headless Services

NXDOMAIN is where Kubernetes DNS troubleshooting meets application configuration. The most common cause is embarrassingly simple: the code asks for a short name in the wrong namespace. A Pod in the payments namespace resolving postgres gets postgres.payments.svc.cluster.local, and if the database Service lives in the data namespace, CoreDNS correctly answers NXDOMAIN. The fix is a fully qualified name, postgres.data.svc.cluster.local, or a deliberate ExternalName Service, not a CoreDNS change. The second common cause is a Service that exists but has no ready endpoints: CoreDNS answers from the Service record, and a selector typo or failing readiness probe means there is nothing healthy behind the name. That failure belongs to the Service no-endpoints runbook, and DNS is only the messenger.

Headless Services add a third pattern. A headless Service returns Pod IPs directly instead of a ClusterIP, which is what StatefulSets rely on for stable per-Pod names. If a client caches the answer too long, it keeps dialing a Pod IP that was replaced during a rollout. That looks like a DNS failure in application logs — connection refused to an IP that no longer exists — while CoreDNS is answering perfectly. The fix is client-side: honour TTLs, re-resolve on connection failure, and avoid pinning Pod IPs in connection pools.

Negative caching is the fourth pattern, and it bites right after you fix something. CoreDNS caches NXDOMAIN answers for a short TTL, so a Service created a minute ago can still look missing to clients holding the cached negative answer. Wait out the TTL or flush by rolling the client, and verify with a fresh lookup from the debug Pod rather than trusting the application's cached view.

bash
kubectl -n data get svc postgres
kubectl -n data get endpointslice -l kubernetes.io/service-name=postgres
kubectl -n payments exec -it dnsutils -- nslookup postgres.data.svc.cluster.local

The discipline in this section is to separate "the name does not exist" from "the name exists but nothing healthy sits behind it" from "the name resolved to something stale". Those are three different owners — application config, workload health, and client caching — and paging the platform team for all three is how DNS incidents burn an afternoon.


8. Kubernetes DNS troubleshooting fixes: dnsConfig, FQDNs and NodeLocal DNSCache compared

Fix selection is where Kubernetes DNS troubleshooting turns into engineering judgement, because each fix trades scope, risk and durability differently. Per-Pod dnsConfig changes are surgical: they fix one workload, roll out with its Deployment, and can be reverted the same way. Fully qualified names are even more surgical but require code or config changes in every caller. NodeLocal DNSCache is the platform-level fix: it removes the DNAT conntrack path for most lookups, absorbs repeat queries locally, and keeps working when CoreDNS is briefly unavailable, at the cost of a DaemonSet to operate and a kubelet configuration change to point Pods at the local cache.

Fix Scope Removes conntrack race Cuts CoreDNS load Main risk
ndots 1 in dnsConfig One workload No, fewer packets race Yes, fewer expansions Breaks reliance on search domains
single-request-reopen One glibc workload Yes, per-socket queries No Ignored by musl images
FQDN with trailing dot One call site Reduces packets sharply Yes Code change in every caller
NodeLocal DNSCache Whole node / cluster Yes, bypasses ClusterIP DNAT Yes, local cache hits DaemonSet ops, staged rollout
Scale CoreDNS replicas Cluster DNS tier No Spreads load Masks race faults, cost

A sane sequence for most clusters is to fix the loudest workload first with dnsConfig, prove the timing improvement, then schedule NodeLocal DNSCache as the durable platform fix. That order gives the incident a same-day mitigation and the platform a permanent answer, without betting the cluster on a midnight DaemonSet rollout. Whichever fix you choose, keep the CoreDNS autoscaler or replica count honest: NodeLocal cache reduces load, but cache misses still reach CoreDNS, and a two-replica deployment remains a thin margin for a large cluster.

Verification is part of the fix, not an afterthought. Re-run the timed lookup loop from the affected namespace, confirm the five-second cluster is gone, and watch CoreDNS query rate drop if you cut amplification. Record before-and-after numbers in the incident notes: lookup p99, NXDOMAIN rate, CoreDNS requests per second. Those three numbers are what let the next on-call engineer trust that the fix held, instead of rediscovering the race at the next traffic peak.


9. Kubernetes DNS troubleshooting at scale: CoreDNS capacity, caching and NetworkPolicy

Scale changes which Kubernetes DNS troubleshooting faults matter. At fifty Pods, CoreDNS is invisible. At five thousand, every inefficiency multiplies: ndots amplification becomes a meaningful fraction of cluster UDP traffic, cache hit ratio decides whether CoreDNS sees one query or fifty for the same name, and a NetworkPolicy that accidentally drops UDP port 53 turns into a namespace-wide outage that looks exactly like a CoreDNS failure. The checks in this section are the ones that keep DNS boring as the cluster grows.

NetworkPolicy deserves first mention because it fails silently. A default-deny egress policy that forgets to allow DNS will break every lookup from that namespace while CoreDNS stays perfectly healthy and its logs stay empty. The tell is scope: one namespace broken, others fine, no queries arriving. Allow egress to the kube-dns Service on UDP and TCP port 53 — TCP matters because large responses and retries use it — and test from the debug Pod after every policy change. The CNI guide explains how policy enforcement differs across dataplane implementations, which changes where drops are counted.

Capacity planning for CoreDNS is arithmetic, not folklore. Measure queries per second per Pod at peak, multiply by your growth margin, and size replicas so that losing one CoreDNS Pod to a node drain still leaves headroom. Watch the cache plugin: a high hit ratio with low latency is healthy, while a falling hit ratio during an incident often means clients are retrying uncached failures. Pin CoreDNS Pods with anti-affinity so a single node loss cannot take out every replica, and give the deployment a PodDisruptionBudget so voluntary disruptions respect the same rule.

Finally, treat DNS as a dependency with an SLO. Alert on CoreDNS SERVFAIL rate, p99 query duration and replica availability, and dashboard client-side resolution latency if your service mesh or SDKs expose it. The goal is to hear about DNS degradation from a graph, not from a checkout timeout. Teams that graph DNS early stop having five-second-stall incidents, because the conntrack race shows up as a latency tail long before it shows up as an outage.


10. Use cases: Kubernetes DNS troubleshooting on call, in interviews and in platform reviews

The same Kubernetes DNS troubleshooting sequence serves three different rooms. On call, it is a triage script: time the failure, locate its scope, match it to the matrix, apply one fix, re-measure. In an interview, it is a depth probe: explaining why a 500m-style average looks fine while tails explode is the DNS version of the throttling story, and walking the five hops with evidence at each one separates operators from tutorial readers. In a platform review, it becomes a checklist: ndots policy per workload class, NodeLocal DNSCache coverage, CoreDNS replica headroom, NetworkPolicy templates that allow port 53, and dashboards that would catch the next race early.

For on-call use, keep the debug Pod pattern ready before the incident. A namespace-scoped dnsutils Pod you can create in seconds, with the exact commands from section 1 in the runbook, removes the fumbling that eats the first fifteen minutes. Pair it with a one-line timing loop so the evidence is numeric:

bash
kubectl -n payments exec dnsutils -- sh -c 'for i in $(seq 1 20); do /usr/bin/time -f "%e" nslookup api.stripe.com 2>&1 | tail -1; done'

For interviews, practise the five-second stall explanation out loud: glibc sends A and AAAA from one socket, DNAT plus conntrack can drop one packet, the resolver waits five seconds, ndots multiplies the chances, and NodeLocal DNSCache removes the path. Then add the honest limits: musl ignores the glibc option, scaling CoreDNS does not fix a kernel race, and a restart that helps is evidence, not a fix. Interviewers reward that structure because it mirrors how production incidents actually unfold.

For platform reviews, turn the matrix into policy. New workloads that resolve external APIs get ndots 1 by default. NetworkPolicy templates include DNS egress. CoreDNS runs with anti-affinity, a disruption budget and alerts on SERVFAIL and p99 duration. Each rule traces back to a row in the matrix, which keeps the policy defensible when a team asks why it exists. That traceability is the difference between a platform standard and a superstition.


11. Limits, failure modes and senior takeaways for Kubernetes DNS troubleshooting

Every fix in Kubernetes DNS troubleshooting has a boundary, and naming the boundary is part of the fix. Lowering ndots breaks workloads that quietly depend on search-domain expansion for short names across namespaces; audit callers before changing it cluster-wide. NodeLocal DNSCache adds a node-level component that can itself fail, serve stale answers within TTL, or mask a CoreDNS outage until cache entries expire. FQDNs with trailing dots are precise but brittle when namespaces are renamed. Caching, at every layer, trades freshness for speed, so a DNS fix and a DNS symptom can both hide inside a TTL.

There are also faults this runbook deliberately does not solve. If the upstream resolver is down, CoreDNS will faithfully return SERVFAIL and the fix belongs to the network team. If the CNI dataplane is dropping UDP under load, DNS is the victim, not the cause, and the container networking troubleshooting guide is the right next read. If an application hardcodes an IP or pins a resolution forever, no resolver fix will save it; that is a client bug wearing a DNS costume.

The senior takeaways compress to four habits. Time the failure before touching configuration, because timing separates races from outages. Locate the scope — Pod, namespace, node or cluster — before choosing a fix, because scope identifies the layer. Change one layer at a time and re-measure, because unmeasured fixes become folklore. And treat any fix that works by restart as a clue, not a conclusion. Clusters run by teams with those habits still have DNS incidents, but they are short, evidenced and rarely repeated.

Keep the debug Pod, the matrix and the timing loop in the runbook next to the commands, and update them after every incident with the row you actually hit. DNS will stay invisible on the good days. On the bad days, you will know exactly which hop to interrogate first.

Frequently Asked Questions

Why does Kubernetes DNS troubleshooting start with timing the failure?

Because timing separates the fault classes. Failures clustered at exactly five seconds point to a resolver timeout, usually the conntrack race. Instant NXDOMAIN points to search domains, namespace or a missing Service. SERVFAIL points inside CoreDNS or its upstream. Timing first prevents the classic mistake of scaling CoreDNS for a kernel race it cannot fix.

How does ndots:5 slow down Kubernetes DNS troubleshooting cases?

With ndots:5, any name with fewer than five dots is tried against each search domain before the name itself. An external name like api.stripe.com burns three wasted expansions, and with A plus AAAA queries that is eight UDP packets for one lookup. The amplification loads CoreDNS and gives packet-loss races more chances to fire.

What causes the five-second stall in Kubernetes DNS troubleshooting?

glibc sends A and AAAA queries from the same UDP socket. Both packets are DNAT-translated toward a CoreDNS Pod, and the kernel conntrack insert can drop one under load. The resolver then waits out its five-second timeout and retries successfully, which is why the failure is intermittent and CoreDNS logs look clean.

Does NodeLocal DNSCache fix Kubernetes DNS troubleshooting stalls?

Yes, for the race class of stalls. NodeLocal DNSCache answers most lookups from a node-local cache, bypassing the ClusterIP DNAT and conntrack path where the race lives. It also cuts CoreDNS load. It does not fix a bad Corefile, a wrong namespace or a NetworkPolicy drop, so match it to the right matrix row.

Why does Kubernetes DNS troubleshooting show NXDOMAIN for a Service that exists?

Usually the short name is being resolved in the wrong namespace, so the expanded name genuinely does not exist. Use the fully qualified name with the Service namespace. The other cause is a Service with no ready endpoints from a selector typo or failing readiness probe, which is a workload health fault, not a DNS fault.

When should Kubernetes DNS troubleshooting scale CoreDNS instead of changing clients?

Scale CoreDNS when its own metrics show the strain: rising p99 query duration, SERVFAIL responses, OOMKilled or throttled CoreDNS containers, and query rates climbing with cluster size. If CoreDNS answers in milliseconds while clients stall for five seconds, the fault is in the resolver path and scaling changes nothing.

What is the safest first fix in Kubernetes DNS troubleshooting?

Scope the fix to the failing workload: set ndots to 1 and add single-request-reopen in that workload's dnsConfig, roll it out, and re-time lookups from its namespace. That is reversible in minutes and proves the mechanism. Schedule NodeLocal DNSCache afterwards as the durable platform-level fix.

⚡ KUBERNETES SCENARIO INTERVIEW PREP

Preparing for Senior Platform & SRE Interviews

Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.

Explore Interview Scenarios →