Bug 1184710 - dnsmasq needs to be restarted after reboot for dns to work in a Docker container
Summary: dnsmasq needs to be restarted after reboot for dns to work in a Docker container
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: docker-io
Version: 21
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
Assignee: Sally
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-01-22 05:23 UTC by Jason Shepherd
Modified: 2015-07-08 23:07 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-08 23:07:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
DNSMASQ configuration (25.52 KB, text/plain)
2015-02-09 22:55 UTC, Jason Shepherd
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1128208 0 unspecified CLOSED docker io not using proper DNS 2021-02-22 00:41:40 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.