I’m having a problem resolving DNS on my docker container, even though the DNS server is reachable.
I try to look up google.com using nslookup and I fail:
sudo docker run busybox nslookup google.com nslookup: can't resolve 'google.com' Server: 184.108.40.206 Address 1: 220.127.116.11
I see that the DNS server used by the container is 18.104.22.168, so I try to ping it and it is reachable:
sudo docker run busybox ping 22.214.171.124 -c 4 PING 126.96.36.199 (188.8.131.52): 56 data bytes 64 bytes from 184.108.40.206: seq=0 ttl=127 time=151.495 ms 64 bytes from 220.127.116.11: seq=1 ttl=127 time=150.644 ms 64 bytes from 18.104.22.168: seq=2 ttl=127 time=149.766 ms 64 bytes from 22.214.171.124: seq=3 ttl=127 time=151.873 ms --- 126.96.36.199 ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max = 149.766/150.944/151.873 ms
This means the container has internet access and it can reach the Google DNS server, but for some reason it cannot resolve any address.
Can anyone help me figure out why?