Kubernetes Pod – lookup server misbehaving

Kubernetes Pod - lookup server misbehaving
  • If you're facing lookup server misbehaving issue on your local environment while using kind or any other local kubernetes cluster solution.
  • There is a quick fix, this is only recommended for dev environment.
dial tcp: lookup github.com on 10.96.0.10:53: server misbehaving
  • This one works for Ubuntu Ubuntu 18.04.4 LTS
  • Copy the nameservers details from /run/systemd/resolve/resolv.conf and append it in /etc/resolv.conf
  • Example
sudo cat /run/systemd/resolve/resolv.conf

nameserver 175.100.191.221
nameserver 8.8.8.8
  • Add these nameserver details in you're /etc/resolv.conf
nameserver 175.100.191.221
nameserver 8.8.8.8

nameserver 127.0.0.53
options edns0
  • Delete and create new a cluster and test:
~$ kubectl run -it --rm --restart=Never busybox1 --image=busybox sh
If you don't see a command prompt, try pressing enter.
/ # ping -c 10 google.com
PING google.com (172.217.167.174): 56 data bytes
64 bytes from 172.217.167.174: seq=0 ttl=116 time=9.727 ms
64 bytes from 172.217.167.174: seq=1 ttl=116 time=8.791 ms
64 bytes from 172.217.167.174: seq=2 ttl=116 time=13.593 ms
^C
--- google.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 8.791/10.703/13.593 ms

/ # ping -c 10 github.com
PING github.com (13.234.176.102): 56 data bytes
64 bytes from 13.234.176.102: seq=0 ttl=49 time=9.722 ms
64 bytes from 13.234.176.102: seq=1 ttl=49 time=15.734 ms
64 bytes from 13.234.176.102: seq=2 ttl=49 time=13.384 ms
^C
--- github.com ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 9.722/12.946/15.734 ms
/ # exit
pod "busybox1" deleted