docker.io host name resolution fails after switching networks

Bug #1387875 reported by Horst Schirmeier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When switching networks, docker.io (1.0.1~dfsg1-0ubuntu1~ubuntu0.14.04.1 from trusty-updates) does not notice when the contents of /etc/resolv.conf change. This is a quite common situation when using a notebook with dnsmasq disabled in /etc/NetworkManager/NetworkManager.conf. (Using dnsmasq together with docker.io is out of the question due to bug #1387805.)

In the following example, 99.99.99.99 is a placeholder for the DNS server address in the network the notebook was connected to previously. This IP is not mentioned in /etc/resolv.conf anymore. From the current network, this IP is not reachable.

$ docker build some-image
Sending build context to Docker daemon 4.096 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:utopic
Pulling repository ubuntu
2014/10/30 21:55:00 Get https://index.docker.io/v1/repositories/ubuntu/images: dial tcp: lookup index.docker.io on 99.99.99.99:53: no answer from server
make: *** [all] Error 1

Expected behavior: docker should be automatically notified when /etc/resolv.conf changes, and use the appropriate DNS server for the network we're currently connected to.

Workaround:

$ sudo service docker.io restart
docker.io stop/waiting
docker.io start/running, process 2369
$ docker build some-image
Sending build context to Docker daemon 4.096 kB
Sending build context to Docker daemon
Step 0 : FROM ubuntu:utopic
Pulling repository ubuntu
277eb4304907: Download complete
511136ea3c5a: Download complete
[...]

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Is this still a problem?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in docker.io (Ubuntu):
status: New → Confirmed
Revision history for this message
Sean Dilda (seandilda) wrote :

I'm hitting the same/very similar bug in ubuntu 19.10 with docker.io 19.03.2-0ubuntu1

systemd-resolved is now involved, but its the same symptoms. If I start a docker container on may laptop, the container starts with resolv.conf set to the contents of /run/system/resolve/resolv.conf If my DNS servers change (log onto/off of VPN, change between work and home networks,etc), the containers do not update and now have bad DNS servers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.