Unable to enter a kubernetes pod. Error from server: error dialing backend: dial tcp: lookup (node hostname) on 168.63.129.16:53: no such host

11/16/2017

We have deployed a K8S cluster using ACS engine in an Azure public cloud. We are able to create deployments and services but when we enter a pod using "kubectl exec -ti (pod name) (command)" we are receiving the below error,

Error from server: error dialing backend: dial tcp: lookup (node hostname) on 168.63.129.16:53: no such host

I looked all over the internet and performed all I could to fix this issue but no luck so far. The OS is Ubuntu and 168.63.129.16 is a public IP from Azure used for DNS.(refer below link)

https://blogs.msdn.microsoft.com/mast/2015/05/18/what-is-the-ip-address-168-63-129-16/

I've already added host entries to /etc/hosts and entries into resolv.conf of the master/node server and nslookup resolves the same. I've also tested by adding --resolv-conf flag to the kubelet but still it fails. I'm hoping that someone from this community can help us fix this issue.

-- Leo Lazarus
azure
dns
kube-dns
kubectl
kubernetes

2 Answers

2/27/2019

The problem was in VirtualBox layer

sudo ifconfig vboxnet0 up

Solution is taken from here https://github.com/kubernetes/minikube/issues/1224#issuecomment-316411907

-- itsnikolay
Source: StackOverflow

3/22/2018

Verify the node on which your pod is running can be resolved and reached from inside the API server container. If you added entries to /etc/resolv.conf on the master node verify they are visible in the APIserver container, if they are not, restarting the API server pod might be helpful

-- Sreekanth Pothanis
Source: StackOverflow