Even though I can successfully ping a host from a Docker container (i.e.
docker run busybox ping -c 1 126.96.36.199), requests involving a DNS lookup result in a timeout (e.g.
docker run nslookup google.com).
I’ve looked at suggestions from this NPM Github issue, namely editing
/etc/hosts, connections from different networks, and rebooting the machine, all without any success.
I’ve also tried Robin Winslow’s Fix Docker’s networking DNS config however, explicitly specifying the local or global DNS server fails.
$ docker run --dns <local DNS IP> busybox nslookup google.com >>> nslookup: write to <local DNS IP>: No route to host ;; connection timed out; no servers could be reached $ docker run --dns 188.8.131.52 busybox nslookup google.com >>> nslookup: write to '184.108.40.206': No route to host ;; connection timed out; no servers could be reached