Name resolution failure


I’m running Docker CE on Ubuntu 22.04.

Any image I try to run - e.g. Ubuntu, Debian, nicolaka/netshoot - has trouble performing name resolution, it’s unable to reach DNS servers, and just pinging fails.

My /etc/docker/daemon.json :

  "bip" : "",
  "dns" : [""]

Output of “ip a” for docker0 :

5: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:96:9f:92:b2 brd ff:ff:ff:ff:ff:ff
    inet brd scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:96ff:fe9f:92b2/64 scope link 
       valid_lft forever preferred_lft forever

My /etc/resolve.conf inside the container:


Output of “ip r” inside a container :

default via dev eth0 dev eth0 proto kernel scope link src

Trying to ping default gateway inside a container gives no output:

PING ( 56(84) bytes of data.
( no output )

I’ve tried restarting Docker but it changed nothing.

My machine is on a corporate network, so that’s probably the reason - trouble is, our IT department won’t help, so I’ve turned to help here.

Any ideas?

The ip indicates that you are using a public ip (range) provided your isp.
Is this correct?

If it is supposed to be a private network range, you might want to look at Private network - Wikipedia for a list of valid cidr ranges.

My router gives 192.168.0.* IPv4 (and also an IPv6, which I don’t think matters here) - so I edited /etc/docker/daemon.json with this address. I could have used but my corporate VPN uses that.

Do you think trying or might help?

By the way the issue happens even when I’m not connected from the corporate VPN

Can you use from the host? If you are in a corporate network and not just conected to the VPN, it is also possible that using the name server of Google is not allowed. It is not allowed where I work.

That would be the default range, but as long as you use a valid ip address it shouldn’t affect name resolution.

We can help with Docker related questions but only your IT deparment can tell you which IP ranges you should use and even what you are allowed to use.

Using or absolutely works on the host when I’m on the VPN and when I’m off of it.