Join GitHub today
DNS resolution fails on Ubuntu k8s cluster #1017
DNS resolution (nslookup) should work right out of the box on a busybox pod for addresses like
The following error is observed.
Steps to Reproduce (for bugs)
I'm having the same problem with kubernetes 1.10.5 and Ubuntu 18.04 LTS. I'm new to Kubernetes and am probably misunderstanding how this all works. Would appreciate any guidance.
If I go to the shell on a busybox pod I can't resolve kubernetes.default or kubernetes.x where x is one of three namespaces I've created.
But I'm getting slightly farther than the OP. When I run nslookup I get:
This suggests that the nameserver IP is successfully resolving to a PTR record of some sort? Sure enough, testing nslookup against the above name of the nameserver works:
So nslookup appears to be able to reach a 10.96 IP even though there are no interfaces, IPs or routing entries on my nodes or pods related to any 10.xxx network.
And it appears that kube-dns is not forwarding other requests to the node's nameserver entries, which are present in /etc/netplan/bond0.yaml.
What am I missing?
Hope to hear from you...
OK, found this other earlier issue: #983
Which is much like mine, they're also getting the reverse lookup for the kube-dns pod
Added the configmap for kube-dns with the upstreamNameserver setting pointed at my on-premise nameservers and I can now nslookup both outside and on-premise hostnames but it takes just about exactly 20s to return an address. In fact, for google.com it takes 20s to return an IPv6 address and then another 20s to return IPv4.
This smells like a timeout setting that needs to be changed.
OK, it's getting weirder.
After deleting and relaunching the busybox pod, nslookup now immediately returns a "non-authoritative" answer. But then it hangs for 5s exactly and returns an error "*** Can't find s---.org: No answer"
However, calls like ping resolve and reply right away. I think this is an nslookup quirk, and I'm calling it good for now.
From inside busybox pod after applying upstreamServer config @lukaszpy mentioned above I get the following for external nslookups (minikube v0.28.1 on ubuntu 18.04):
/ # nslookup 220.127.116.11
/ # nslookup google.com
*** Can't find google.com: No answer
When I attempt kubernetes.default, I get this:
** server can't find kubernetes.default: NXDOMAIN
*** Can't find kubernetes.default: No answer