TECHNOLOGY

Slow DNS in a Pod: search domains and ndots

In this article
THE QUICK TAKE

Slow DNS inside a Pod can result from search domains and ndots even when routing works. Inspect the effective /etc/resolv.conf and query sequence. Separate name-resolution delay from connection establishment and GPU execution time.

Slow DNS inside a Pod can result from search domains and ndots even when routing works. Inspect the effective /etc/resolv.conf and query sequence. Separate name-resolution delay from connection establishment and GPU execution time.

Preserve the Pod resolver

Capture dnsPolicy, dnsConfig and resolv.conf from the intended environment. hostNetwork and ordinary Pods can use different rules. Compare a short Service name, a fully qualified name and an external dependency. Host nslookup results do not directly describe a container: search lists, nameservers and resolver libraries may differ. Record the namespace too, since it supplies context for short Service names.

Official reference 1.

Understand ndots

Ndots affects lookup order relative to the search list according to the number of dots in a name. Several suffixes can produce multiple queries before the expected external lookup. Resolver-library behavior also matters, so a configured value alone does not establish the actual sequence. Observe queries and responses with permitted tools. A trailing-dot fully qualified form can help in a controlled test, while application compatibility requires separate verification.

Official reference 2.

Compare one dependency consistently

Suppose a worker accesses artifact.example.org and resolv.conf contains several cluster search domains with ndots 5. Measure lookup in the application, then compare a fully qualified form using a diagnostic tool. The value 5 describes an example configuration rather than a universal cause or recommendation. Save query count, response codes and duration to distinguish extra NXDOMAIN responses from waiting on an unavailable DNS server.

CheckDifference to observe
Short nameNamespace and suffix context
Full nameLess destination ambiguity
Pod resolverEffective workload configuration
Host resolverA separate comparison scope

Change DNS policy selectively

Correct an invalid search list, dnsPolicy or application reference when evidence supports it. Do not minimize ndots across every Pod based on one external lookup; necessary short internal names may behave differently. If requests arrive promptly but responses are delayed, inspect CoreDNS and its upstream. If only one binary image is affected, compare resolver implementations. A connection timeout cannot remove additional resolution work that happens before connecting.

Test both naming classes

After the change, repeat external dependency resolution and internal Service lookup from a new Pod using the same image. Preserve resolv.conf, query sequence and DNS-stage timing. Success includes expected resolution without breaking required internal access. The artifact connects configuration scope with observed behavior. Repeat it after base-image upgrades, which can change resolver behavior independently of Kubernetes settings. Keeping DNS timing separate prevents these delays from being incorrectly attributed to GPU performance or the inference engine.

Related operational reading: network and uptime; vllm localhost container port.

← All articles