What is the ndots setting and why does it affect Kubernetes DNS performance?
AdvancedConceptDNS
Answer
ndots:5 in a pod's resolv.conf means any name with fewer than 5 dots is first tried with each search domain appended (api.example.com.default.svc.cluster.local, then ...svc.cluster.local, and so on) before the bare name. External lookups therefore generate several NXDOMAIN queries first.
Mitigate by using trailing-dot FQDNs, lowering ndots with dnsConfig, or running NodeLocal DNSCache.
dnsConfig:
options:
- name: ndots
value: "2"
More on DNS
What does DNS do and what happens when you type a URL into a browser?BeginnerWhat are the common DNS record types?BeginnerWhat is the difference between a recursive resolver and an authoritative server?IntermediateExplain the DNS resolution chain step by step with dig.IntermediateWhat is TTL in DNS and how does it affect changes?BeginnerWhat is negative caching in DNS?Intermediate