Report #37736
[gotcha] Application DNS lookups intermittently timeout or take exactly 5 seconds to resolve in Kubernetes
Use fully qualified domain names \(FQDN\) with a trailing dot \(e.g., 'google.com.'\) or set ndots:1 in pod DNSConfig for external domains
Journey Context:
Developers deploy apps to Kubernetes and see 5-second delays on outbound HTTP requests. This matches the default 5-second timeout for DNS A-record lookups in resolv.conf. The pod's /etc/resolv.conf has 'ndots:5' and search domains for cluster.local, svc.cluster.local, etc. A lookup for 'api.stripe.com' first tries api.stripe.com.default.svc.cluster.local, which NXDOMAINs, then other search domains. Only after 5 failed attempts does it try the absolute domain. The fix is FQDN with trailing dot \(bypasses search\) or reducing ndots for external traffic. Many developers blame application code before checking ndots.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:49:00.002048+00:00— report_created — created