DNS & CoreDNS Latency/Failure Diagnostics
Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls.
In plain words
DNS tuning is separating directory lookup, cache, and upstream roads before adding more clerks to a line caused by a missing bridge. The simple Kubernetes rule is: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Think of it like…
DNS tuning is separating directory lookup, cache, and upstream roads before adding more clerks to a line caused by a missing bridge.
Where you’ve seen it
An SRE testing a diagnosis runs kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local. Expected evidence: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache. If the run instead shows this symptom, stop and restore the last known state: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
Words you’ll hear
- CoreDNS
- For this lesson, CoreDNS is the controlling idea: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Latency
- Latency is the checkpoint; run
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.localand inspect the owner chain. An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses. - ndots
- ndots is the outcome to preserve; the cost is explicit: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
- Verification evidence
- The evidence command is
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local. It connects the declaration to this behavior: Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls.
Visual diagram
Theory & deep dive
How CoreDNS reaches the intended state
Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls. CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
The concrete checkpoint is kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local; compare the CoreDNS owner, Latency state, and ndots outcome instead of treating YAML acceptance as proof.
Run kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local after the change and correlate the result with Events and the owning object. CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Latency: failure boundary and production cost
An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses. The prerequisite contract is concrete: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure. A safe design limits blast radius, records the last good configuration, and uses kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local as a deterministic rollback checkpoint.
Capture the current state with kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
How it works, step by step
Step 1 of 41. Define the symptom and SLI
Turn the user symptom into a measurable question and select a telemetry source: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Goal
- Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls.
- Owner
- CoreDNS
When to use it & trade-offs
What it is
Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls. CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Why it matters: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses. The invariant at risk is specific: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache. The quickest fact check before changing the design is kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local.
When to reach for it
- Use CoreDNS to enforce this invariant: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Use Latency evidence from
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.localin reviews and incident timelines. Diagnose CoreDNS latency, NXDOMAIN storms, and ndots pitfalls. - Choose the managed observability backend route only when this cost is justified by governance or scale: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
When to avoid or be careful
- Avoid assuming CoreDNS is complete after YAML submission; the required behavior is concrete: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.localfirst: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses. - Avoid adopting a heavier platform wrapper before measuring its cost: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
Native, manual, and managed paths for CoreDNS
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local.Strengths: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Watch out: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure. Recovery must also recognize this signal: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local; the expected invariant is: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.Strengths: kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike CoreDNS, it does not make this symptom self-documenting: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
Watch out: The added platform ownership buys value at this cost: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Trace CoreDNS to ndots through Latency; the invariant is: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Recognize the symptom: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
- Justify the cost: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
- Verify with kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local instead of only inspecting YAML.
Benchmarks & rules of thumb
- 5
- default ndots value in many resolvers
- 53
- DNS port
- 2
- transports should be tested: UDP and TCP
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the CoreDNS owner contract: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache.
- Ignoring this telltale condition leads to unrelated changes: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses.
- Repeating
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.localwithout an owner for remediation wastes retry cost. Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache?
- Which owner object, logs, and Events would you inspect for this symptom-An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses-?
- At what threshold would this cost become unacceptable: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure?
kubectl get pods -n kube-system -l k8s-app=kube-dns; kubectl logs -n kube-system -l k8s-app=kube-dns; kubectl exec dns-test -- dig api.prod.svc.cluster.local, name the failure, then justify the cost. Invariant: CoreDNS diagnosis measures NXDOMAIN, SERVFAIL, REFUSED, lookup latency, cache hits, upstream timeouts, and Pod resolver ndots behavior before tuning replicas or cache. Failure: An external FQDN without a trailing dot can traverse all search suffixes under ndots, and UDP-only firewall tests miss TCP fallback or large responses. Cost: Autoscaling CoreDNS can hide a bad upstream, while more cache improves common names but lengthens stale-record exposure.Knowledge check
Put it into practice
Practice related interview Q&A
Apply DNS & CoreDNS Latency/Failure Diagnostics with generative AI interview Q&A and hands-on practice.