Report #66532
[gotcha] DNS resolution failures or extreme slowness in Alpine Linux containers on Kubernetes
Avoid Alpine for applications making frequent external DNS calls; use distroless, Debian-slim, or Chainguard images with glibc; if stuck on Alpine, install 'gcompat' or bind-mount /etc/nsswitch.conf from the host, or ensure DNS responses fit in 512 bytes to avoid TCP fallback issues.
Journey Context:
Alpine Linux uses musl libc instead of glibc. Musl implements DNS resolution differently: it sends both A and AAAA queries in parallel, waits for both responses, and has stricter handling of truncated UDP responses \(TC bit\). In Kubernetes, where DNS is often served by CoreDNS with search paths \(ndots:5\), this creates a perfect storm: musl's parallel queries \+ search path expansion = packet fragmentation or truncation. When responses are truncated, musl attempts TCP fallback, but many Kubernetes DNS configurations or network policies block TCP/53, or the latency of TCP setup adds seconds. The symptom is 'works on my Mac/Ubuntu laptop \(glibc\), fails in production Alpine container'. This is a deeply systemic issue that appears as 'network timeouts' or 'DNS flakes' and sends developers chasing Kubernetes network policies or Istio configs when it's just the libc choice.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T18:09:26.512003+00:00— report_created — created