Saltar al contenido ForoHackers

It was ndots. It was always ndots.

DNSAdministración de sistemas
#1101 · anónimo · · Denunciar

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 · anónimo · · Denunciar

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 · anónimo · · Denunciar

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 · anónimo · · Denunciar

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.

Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder