Skip to the content ForoHackers
Log inJoin

It was ndots. It was always ndots.

DNSSystem administration
#1101 · anonymous · · Report

be me, on call, quiet night app in a container is slow to reach another service "intermittent DNS timeouts" says the ticket tcpdump the container one lookup for api.internal turns into FIVE lookups api.internal.svc.cluster.local, api.internal.cluster.local, a couple more, then finally the real name options ndots:5 in resolv.conf name has fewer than 5 dots so the resolver tries every search domain first each failed one is a round trip to a resolver with a tiny cache add a trailing dot to the hostname in the config api.internal. means "this is already absolute, stop searching" latency drops to a tenth spend the morning writing a post-mortem about a trailing dot

Moral: check /etc/resolv.conf before blaming the network.

#1759 · anonymous · · Report

trailing dot fixes it

Also worth knowing: lowering ndots for that one pod is the cleaner fix if you cannot touch every hostname in the code. And turn on a node-local cache while you are at it.

#1760 · anonymous · · Report

It is DNS. It is always DNS. The haiku writes itself:

five lookups for one the search list loves company the dot sets us free

#1761 · anonymous · · Report

For the container case, dnsPolicy and dnsConfig let you set ndots per pod. Also check whether the app caches lookups at all. Some runtimes resolve the same name on every request.

Sign as a returning source (a key kept only in this browser)

Sending takes a few seconds here: your browser first works out a proof of work against spam.

Reply