0

Running a (slightly modified) Ubuntu:16.04 docker image, cannot access DNS servers. This is evidenced by being able to ping a resolved ip address for google.com (such as 172.217.4.142, which was resolved on a different computer), but not being able to ping google.com.

root@12345678910:/# ping -c 1 216.58.194.174
PING 216.58.194.174 (216.58.194.174) 56(84) bytes of data.
64 bytes from 216.58.194.174: icmp_seq=1 ttl=46 time=20.5 ms
--- 216.58.194.174 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 20.551/20.551/20.551/0.000 ms

root@12345678910:/# ping -c 1 google.com   
ping: unknown host google.com

Most of my googling turns up issues about setting DNS flags. However I have tried setting the DOCKER_OPTS variable in /etc/default/docker to point to many DNS servers:

DOCKER_OPTS="--dns 209.244.0.3 --dns 209.244.0.4 --dns 64.6.64.6 --dns 64.6.65.6 --dns 8.8.8.8 --dns 8.8.4.4 --dns 84.200.69.80 --dns 84.200.70.40 --dns 8.26.56.26 --dns 8.20.247.20 --dns 208.67.222.222 --dns 208.67.220.220 --dns 199.85.126.10 --dns 199.85.127.10 --dns 81.218.119.11 --dns 209.88.198.133 --dns 195.46.39.39 --dns 195.46.39.40 --dns 192.95.54.3 --dns 192.95.54.1 --dns 208.76.50.50 --dns 208.76.51.51 --dns 216.146.35.35 --dns 216.146.36.36 --dns 37.235.1.174 --dns 37.235.1.177 --dns 198.101.242.72 --dns 23.253.163.53 --dns 77.88.8.8 --dns 77.88.8.1 --dns 91.239.100.100 --dns 89.233.43.71 --dns 74.82.42.42 --dns 109.69.8.51"

as well as setting the DNS variable in /etc/docker/daemon.json (as described here):

{
  "dns": [ "209.244.0.3", "209.244.0.4", "64.6.64.6", "64.6.65.6", "8.8.8.8", "8.8.4.4", "84.200.69.80", "84.200.70.40", "8.26.56.26", "8.20.247.20", "208.67.222.222", "208.67.220.220", "199.85.126.10", "199.85.127.10", "81.218.119.11", "209.88.198.133", "195.46.39.39", "195.46.39.40", "192.95.54.3", "192.95.54.1", "208.76.50.50", "208.76.51.51", "216.146.35.35", "216.146.36.36", "37.235.1.174", "37.235.1.177", "198.101.242.72", "23.253.163.53", "77.88.8.8", "77.88.8.1", "91.239.100.100", "89.233.43.71", "74.82.42.42", "109.69.8.51" ]
}

with no success for either attempt.

(These are all the IP addresses to DNS servers listed on lifewire)

One option I wanted to try was to reset the ip tables and network bridge, but this suggestion is too old to trust (for example docker -d is no longer a valid command)

A possible issue is that this machine is on university Ethernet, and had to be white-listed with the machine's Ethernet hardware address. On the Ubuntu16 host machine, this was the eno1 device (if I'm using the correct term). My first thought was that, since the docker0 hardware address is different, maybe the university network is blocking that traffic. But I dont think this is the issue because I can still ping the raw IP address. Maybe something is lost in translation when querying DNS?

Any suggestions?

Version info:

  • Host: Linux hostname 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Container: ubuntu:16.04 with the host's ping copied over (can't install with apt without internet).
  • Docker: Docker version 1.12.6, build 78d1802
0

This ended up being an issue with the university network. My understanding is that they were somehow blocking DNS requests, and we were instructed to use their internal DNS server address for in our docker's configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.