CoreDNS commonly provides the internal DNS service in a Kubernetes cluster. Pods use it to resolve Service names into cluster IP addresses, so applications can connect without hard-coding those addresses. section 11.1.3
A Service can be resolved using progressively more specific DNS names:
- <service-name> works when the Service is in the pod’s namespace. section 11.1.3
- <service-name>.<namespace> works from any namespace; longer forms append .svc and the cluster domain. section 11.1.3
- The default cluster domain is cluster.local, but the cluster can configure a different suffix. section 11.1.3
Connecting to a Service by name
A pod can call the quiz Service with curl http://quiz when both are in the same namespace, or curl http://quiz.kiada from another namespace. The pod’s /etc/resolv.conf points to the cluster DNS Service and supplies search domains that make short names work. section 11.1.3
/ # cat /etc/resolv.conf search kiada.svc.cluster.local svc.cluster.local cluster.local localdomain nameserver 10.96.0.10 options ndots:5
Inspect a pod’s resolver configuration to see its search domains and the cluster DNS nameserver. section 11.1.3

