The app log has one line: a name lookup took five seconds, failed once, succeeded on retry. The dashboard is clean. The CoreDNS logs show a normal query rate and no errors. Whatever was wrong has already left.
That five-second pause is not CoreDNS being slow. It is what a resolver does when one of its questions goes unanswered — and four different failures produce the same pause. This post walks through how it fails, how to catch it while it is happening, and which changes actually stop it.

What the hang is
A pod’s /etc/resolv.conf is written by kubelet. It lists the cluster DNS service as the nameserver, three search suffixes, and the option ndots:5. That option says: a name with fewer than five dots is tried against every search suffix before it is tried as written. Most external hostnames have one or two dots, so one lookup becomes a chain.
A query for api.example.com is really four queries: api.example.com.<namespace>.svc.cluster.local, then …svc.cluster.local, then …cluster.local, then the name as written. The first three are meant to return NXDOMAIN quickly. The last is the one that matters.
Now remove the fast answers. If one query in that chain is dropped or hangs, the resolver waits. The C library waits five seconds per server before it retries (RES_TIMEOUT, resolv.conf(5)). Five seconds of nothing, then a retry that succeeds, and the request goes through as if nothing happened. That is the “random” timeout: not a slow cluster, an unanswered packet.
The four places the five seconds come from
- 01
The search chain multiplies one lookup into four
A service-mesh sidecar that resolves every external hostname from its ServiceEntry config will do the full search chain per hostname, every refresh. On a mesh with many external services, CoreDNS and the network carry four times the lookups the app thinks it made. Cutting the chain — an absolute name ending in a dot, or
ndots: 1or2on the pod — cut both the volume and the timeouts for one reporter who tried it (a sample size of one, but the direction is checkable in your own query logs). - 02
A conntrack slot is lost at the wrong moment
DNS is UDP. The kernel tracks each UDP flow for 30 seconds (
nf_conntrack_udp_timeout). When the table is near full, a new DNS flow can fail to get a slot and the packet disappears without an error anywhere in the cluster’s own metrics. The same table can race a reply onto the wrong socket when a client reuses the same source port before the old entry expires. The symptom is the rare timeout that moves around the cluster — and it is invisible in CoreDNS metrics because the query never arrives. - 03
The DNS pod is throttled or starved
CoreDNS under CPU limits gets throttled at exactly the moment traffic spikes; its own latency climbs while the cluster’s dashboards stay green. One operator in this thread found their intermittent in-cluster timeouts were throttling on the CoreDNS pods. Check the throttled-periods counter for the kube-dns namespace before blaming the network.
- 04
The failure is upstream of CoreDNS
If cluster-internal names always resolve and only external names hang, the loss is between a node and the upstream resolvers — a firewall, a cloud resolver, a rate limit. CoreDNS’s forward plugin retries its upstreams and marks one down after two failed health checks, but a quiet packet drop upstream of it looks identical to a CoreDNS problem from the pod side. Capture at both ends once while it is happening and the ambiguity goes away.

Catch one in the act
A hang that passes in seconds cannot be debugged after the fact. Record first, look later. Four checks, in order of how likely they are to catch your cause:
# 1. How many lookups is the pod actually making?
kubectl exec -n prod deploy/cart-api -- cat /etc/resolv.conf
# 2. Is the conntrack table near full, on every node?
# compare used vs max, repeatedly, on each node:
sysctl net.netfilter.nf_conntrack_count \
net.netfilter.nf_conntrack_max
dmesg | grep -i "nf_conntrack: table full"
# 3. Is the DNS pod being throttled?
kubectl -n kube-system get pods -l k8s-app=kube-dns -o wide
# in Prometheus: the rate of the container throttled-periods
# counter for those pods
# 4. Did CoreDNS ever see the query that hung?
# capture on the node AND on the upstream resolver during the eventCheck 1 decides whether cause 01 is in play for this workload. Check 2 is a one-line comparison, not a tool; if the count runs near the maximum on the node the pod was on, you have your mechanism. Check 4 is the expensive one and the most valuable: a capture that shows a query leaving a node and never reaching the resolver ends the CoreDNS-versus-network argument for good, in one capture.
What to change
- Set
ndots: 2(not 1 — some charts hard-code three-label internal names) on workloads that live on external names, and use a trailing dot on names configured in apps and mesh resources. Trade-off: pods that call short internal names by their unqualified name still resolve — the search chain still runs — so keepndots: 5where short names are the convention. Do not remove the search suffixes a workload depends on. - Run NodeLocal DNSCache. It listens on a link-local address on every node, so DNS traffic skips the netfilter rule and the conntrack entry the normal path creates. Its own docs say this directly: skipping DNAT and connection tracking is what reduces conntrack races and keeps UDP DNS entries from filling the table. Its path to CoreDNS can use TCP, which closes its conntrack entry on connection close instead of waiting out the 30-second UDP timeout.
- Give CoreDNS room and watch the throttling counter, not just its latency. An idle node still freezes the pod that owns the throttled CPU quota.
- If check 4 showed loss upstream: raise it with the network owner carrying the capture. No cluster-side setting fixes a packet the firewall never forwards.
Why it hides
Three reasons this class survives quarters without a name. The client-side resolver retries, so the request succeeds and no error metric moves. Cluster metrics stop at the cluster boundary: CoreDNS cannot count a query that never reached it, and the conntrack table belongs to the node, not to any workload’s dashboard. And the failure has no object — no pod restarts, no condition flips, no event — so nothing a cluster-scoped detector watches goes false. A detector that watches cluster objects can be perfect and still miss this: there is nothing to watch. Only node-level counters (conntrack usage, DNS lookup rates) or a capture make it visible.
Srenix probes each Ingress host from outside the cluster on a schedule, and when a probe fails its read-only investigator adds a DNS, TLS or HTTP root-cause line to the finding. That covers the external-facing half of this class — a public host failing because its resolution fails. What it does not do: watch a pod’s internal lookups, the node conntrack table, or CoreDNS throttling. For those, the checks above are the visible surface today.


