How does DNS work in kubernetes?

0 votes
I was just experimenting with kubernetes since a couple of days.Can anybody explain how DNS works in kubernetes?
Jul 12, 2019 in Kubernetes by Sam
• 5,970 points
167 views

1 answer to this question.

0 votes

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.

answered Jul 12, 2019 by Sirajul
• 55,420 points

Related Questions In Kubernetes

0 votes
2 answers

DNS does not resolve with NGINX in Kubernetes

adding to @kalgi's answer Using just the hostname ...READ MORE

answered Aug 30, 2018 in Kubernetes by Nilesh
• 6,970 points
1,842 views
0 votes
1 answer

How to use gravitational teleport in a container/kubernetes environment?

You can use teleport to augment kubernetes ...READ MORE

answered Jun 28, 2018 in Kubernetes by ajs3033
• 7,280 points
848 views
0 votes
1 answer

Error saying "The specified bucket does not exist" in kubernetes

Bucket is created in another region. Looks like ...READ MORE

answered Aug 31, 2018 in Kubernetes by Kalgi
• 51,890 points
1,589 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
7,587 views
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 11, 2019 in Kubernetes by Kalgi
• 51,890 points

reshown Apr 12, 2019 by Kalgi 2,228 views
0 votes
1 answer

How does Kubernetes simplify containerized application deployment process?

A application deployment requires , web tier ...READ MORE

answered Jul 11, 2019 in Kubernetes by Sirajul
• 55,420 points
341 views
0 votes
1 answer

How to build a high availability cluster in Kubernetes?

Add nodes in a HA cluster in ...READ MORE

answered Jul 12, 2019 in Kubernetes by Sirajul
• 55,420 points
435 views