Report #70167
[bug\_fix] DNS resolution fails inside a pod because search domains and ndots:5 cause external names to be mis-qualified
Use the fully-qualified domain name with a trailing dot \(e.g., \`api.example.com.\`\) so the resolver does not append the pod's search domains, or add \`ndots: 2\` \(or lower\) to the pod's \`dnsConfig\` so names with enough dots skip search-list expansion. If the target is a cluster service, use \`..svc.cluster.local.\`
Journey Context:
A pod tries to reach \`api.example.com\` and gets \`NXDOMAIN\`, but \`curl https://api.example.com.\` \(with trailing dot\) works. By default Kubernetes injects a \`resolv.conf\` with \`ndots:5\` and search paths like \`default.svc.cluster.local\`, \`svc.cluster.local\`, \`cluster.local\`. Because \`api.example.com\` has only two dots \(less than 5\), the glibc resolver appends each search domain first, querying \`api.example.com.default.svc.cluster.local\` and so on. These lookups leak internal suffixes to the upstream DNS and, depending on the resolver timing, may fail or return wrong results. A trailing dot tells the resolver the name is fully qualified and to skip search expansion; lowering \`ndots\` in the pod \`dnsConfig\` achieves the same for dotted external names. After applying the change, outbound DNS resolves correctly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:21:11.594774+00:00— report_created — created