DNS is a built-in service in Kubernetes. It gets launched automatically when Kubernetes is setup for the first time.
Kubernetes Domain Name Server schedules a DNS Pod and Service on the cluster, and setup the kubelets to inform individual containers to use the DNS Service’s IP to resolve DNS names.
Every Service which gets defined in the Kubernetes cluster (including the DNS server itself) is assigned with a DNS name.
By default, a client Pod’s DNS search list will include the Pod’s own namespace and the cluster’s default domain.
For Example: if we have a Service named serve1 in the Kubernetes namespace ns1.
A Pod running in namespace ns1 can look up this service by simply doing a DNS query for serve1. A Pod running in namespace collab can look up this service by doing a DNS query for serve1.ns1.