Bug 1184710

Summary: dnsmasq needs to be restarted after reboot for dns to work in a Docker container
Product: [Fedora] Fedora Reporter: Jason Shepherd <jshepherd>
Component: docker-ioAssignee: Sally <somalley>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 21CC: adimania, admiller, dwalsh, golang-updates, hushan.jia, jchaloup, jperrin, lsm5, mattdm, mgoldman, miminar, s, thrcka, vbatts
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-08 23:07:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
DNSMASQ configuration none

Description Jason Shepherd 2015-01-22 05:23:28 UTC
Description of problem:

Docker replies on dnsmasq to have 'listen-address' set to the docker bridge, and have bind-interfaces option turned on. However in this configuration dnsmasq has to start after docker in order for DNS to work in a docker container.


Version-Release number of selected component (if applicable):

docker-io 1.4.0
dnsmasq 2.72


How reproducible:

Reboot the system with docker, and dnsmasq enabled.

Steps to Reproduce:
1. Ensure docker is using the default dns option of 172.17.42.1
2. Use the attached dnsmasq.conf
3. Reboot the system
4. Launch a docker container:

   `docker run -i -t centos /usr/bin/ping www.redhat.com`

Actual results:

   Cannot resolve hostname

Expected results:

   Response from 'akamai' or similar

Additional info:

 See related issue #1128208
 I tried added a systemd 'After' for dnsmasq on docker.service, but it doesn't seem to be honoured by systemd.

Comment 1 Lokesh Mandvekar 2015-02-07 05:02:04 UTC
(In reply to Jason Shepherd from comment #0)
> Version-Release number of selected component (if applicable):
> 
> docker-io 1.4.0

Could you try this with the latest stable rpm? (1.4.1-8.fc21)

> dnsmasq 2.72
> 
> 
> How reproducible:
> 
> Reboot the system with docker, and dnsmasq enabled.
> 
> Steps to Reproduce:
> 1. Ensure docker is using the default dns option of 172.17.42.1
> 2. Use the attached dnsmasq.conf

Hmm, don't see anything attached. I'll try reproducing this once I have your dnsmasq.conf

> 3. Reboot the system
> 4. Launch a docker container:
> 
>    `docker run -i -t centos /usr/bin/ping www.redhat.com`


This works fine on my system, but then again, I'm not using dnsmasq:

$ rpm -q docker-io
docker-io-1.4.1-8.fc21.x86_64

$ sudo docker run -it centos /usr/bin/ping www.redhat.com
PING e1890.b.akamaiedge.net (23.193.135.214) 56(84) bytes of data.
64 bytes from a23-193-135-214.deploy.static.akamaitechnologies.com (23.193.135.214): icmp_seq=1 ttl=51 time=14.4 ms

Comment 2 Jason Shepherd 2015-02-09 22:55:42 UTC
Created attachment 989895 [details]
DNSMASQ configuration

Comment 5 Jason Shepherd 2015-02-11 01:35:53 UTC
I tried with the latest version, 1.4.1-8.fc21, but it didn't make any difference.

I need to restart dnsmasq on the host for dns name resolution to work inside the container.

   sudo systemctl restart dnsmasq

Comment 7 Fedora Admin XMLRPC Client 2015-03-24 03:37:51 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Daniel Walsh 2015-06-03 12:20:14 UTC
Sally could you confirm if this is still a problem.

Comment 9 Sally 2015-07-08 17:41:40 UTC
$ rpm -q docker-io
docker-io-1.6.0-4.git350a636.fc21.x86_64

$ docker run -i -t centos /usr/bin/ping www.redhat.com
PING e1890.b.akamaiedge.net (23.196.44.61) 56(84) bytes of data.
64 bytes from a23-196-44-61.deploy.static.akamaitechnologies.com (23.196.44.61): icmp_seq=1 ttl=48 time=33.6 ms
64 bytes from a23-196-44-61.deploy.static.akamaitechnologies.com (23.196.44.61): icmp_seq=2 ttl=48 time=39.8 ms


No errors.  I followed steps outlined in Description.

Comment 10 Jason Shepherd 2015-07-08 23:07:11 UTC
Also seems to be fixed for me.