CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Administrator

Pod DNS Policy and dnsConfig

The file the kubelet writes into every Pod, the two settings that decide how a name is resolved, and the one combination where the spec field and the file disagree.

Services and Networking Guide 55 of 103 Advanced

Written against the versions above. The search list ends in this lab's domain. Everything about ndots and dnsPolicy behaves the same anywhere.

Four nodes. The hostNetwork Pods here take the node's resolver, which is the point of two of these steps.
Server NameIP AddressOSRolesCPURAMHDD
CKA1001192.168.0.175Ubuntu 26.04 LTSControl Plane Node2 Core4 GB50 GB
CKA1001-NODE01192.168.0.176Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE02192.168.0.177Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA1001-NODE03192.168.0.178Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. What a normal Pod gets handed

  2. Three ways to write the same name

  3. The trap: hostNetwork and cluster DNS

  4. The one line that fixes it

  5. Tuning ndots, and what it costs

Official sources