Menu

1 / 3

Why Lowering ndots Breaks Alpine Pods (But Not Debian) — A Deep Dive into glibc vs musl Resolvers

DEV Community·Eunji·6 months ago
#bTPe0c13
#glibc#kubernetes#devops#ndots#search
Reading 0:00
15s threshold

If you're running Alpine-based pods in Kubernetes and someone tells you to lower ndots for better DNS performance — don't. Or at least, read this first.

We had 5 DNS queries firing for every external domain lookup. The fix seemed obvious: drop ndots:5 to ndots:2 . An AI reviewer warned me it might break internal service resolution. The reasoning didn't hold up when I read the resolver code, so I went ahead — and broke things in a way I didn't expect.

The AI was right about the symptom but wrong about the cause. The breakage is real, but it lives in libc , not in the search algorithm.

TL;DR

Lowering ndots reduces DNS query amplification, but breaks internal service resolution on Alpine pods .

The cause isn't CoreDNS or Kubernetes — it's that musl libc skips the search list when dots ≥ ndots , while glibc falls back gracefully.

If you're on Alpine: switch base images, use FQDNs with a trailing dot, or roll out per-workload via dnsConfig .

The starting point: 5 queries for one domain

Every external DNS…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.