DNS lets pods reach cluster resources by name instead of tracking IP addresses. CoreDNS resolves those names to IP addresses; Kubernetes Services provide stable names and IP addresses for groups of pods. CoreDNS runs as a Deployment in the kube-system namespace. section 1.4.3 section 6.2.3
A Service name is scoped to its namespace. A pod can use a short Service name for a Service in its own namespace. To reach one elsewhere, use <service-name>.<namespace-name>, or the full name <service-name>.<namespace-name>.svc.cluster.local. Check the pod’s /etc/resolv.conf for its search domains and DNS server IP. section 6.2.4 section 6.8
Diagnose a name that works only in another namespace
From a pod in namespace c01383, curl apache-svc returns “Could not resolve host” for a Service in default. curl apache-svc.default succeeds. Inspecting /etc/resolv.conf shows search domains beginning with c01383.svc.cluster.local: the unqualified name is searched from the pod’s namespace. section 6.2.4
When configuring or troubleshooting cluster DNS:
- Check CoreDNS pods and their Deployment with kubectl -n kube-system get po and kubectl -n kube-system get deploy. If CoreDNS is the identified query bottleneck, scale its Deployment and verify the new replicas. section 6.2.3
- If names fail, distinguish DNS from Service connectivity. In a demonstration with CoreDNS scaled to zero, wget apache-svc reports a bad address; after DNS is restored, the request reaches the Service. section 6.2.3
- For a DNS Service IP change, keep the Service CIDR, kube-dns Service IP and kubelet clusterDNS setting aligned. Test a new pod’s resolver file and run nslookup to verify resolution. section 6.1
root@kind-control-plane:/# kubectl exec -it netshoot -- bash bash-5.1# cat /etc/resolv.conf search default.svc.cluster.local svc.cluster.local cluster.local nameserver 100.96.0.10 options ndots:5
This pod resolver output verifies that the changed DNS Service IP, 100.96.0.10, reached a new pod and shows the search domains used for cluster names. section 6.1






