Docker Community Forums

Share and learn in the Docker community.

Problem resolving DNS on docker container even though DNS server is reachable

(Shaharhoch) #1

I’m having a problem resolving DNS on my docker container, even though the DNS server is reachable.

I try to look up using nslookup and I fail:

sudo docker run busybox nslookup
nslookup: can't resolve ''
Address 1:

I see that the DNS server used by the container is, so I try to ping it and it is reachable:

sudo docker run busybox ping -c 4
PING ( 56 data bytes
64 bytes from seq=0 ttl=127 time=151.495 ms
64 bytes from seq=1 ttl=127 time=150.644 ms
64 bytes from seq=2 ttl=127 time=149.766 ms
64 bytes from seq=3 ttl=127 time=151.873 ms

--- 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?