Docker Community Forums

Share and learn in the Docker community.

[Bug] DNS entries in stackfiles not passed to /etc/resolv.conf

dns
dockercloud

(Marcinw) #1

Locally docker-compose.yml with an entry like:

dns:
  - 8.8.8.8

results in /etc/resolv.conflooking like this:

search local
nameserver 8.8.8.8

On Docker cloud, the same entry in the stackfile results in /etc/resolv.conf looking like this:

# cat /etc/resolv.conf                                                                                                                                                   
search <redacted>.local.dockerapp.io                                                                                                           
nameserver 127.0.0.11                                                                                                                                                    
options ndots:1 ndots:0

If a nameserver at 127.0.0.11 is required for Docker Cloud to work, I’d still expect 8.8.8.8 to be injected at least as a secondary nameserver. We’ve had issues with timeouts on the local resolver and really want the secondary one.


(Iteamnetworkdc) #2

@marcinw Absolutely agree! We are having the same issues. The local resolver for services can not handle high throughput. I posted in a similar thread yesterday with no answers.

@fermayo? Anyone over at Docker Cloud?


(Imjosh2) #3

@iteamnetworkdc
@marcinw

I did this to solve the problem:

https://hub.docker.com/r/imj0sh/dockercloud-dnsmasq/


(Marcinw) #4

I’m afraid that editing the /etc/resolv.conf at runtime does not work. I did the same, adding 8.8.8.8 to the list of nameservers, and got it pretty much immediately overwritten by Docker Cloud’s default (DHCP at work, I reckon).

I’m solving this at the application level at the moment - here’s a Go library I wrote to use custom DNS.


(Marcinw) #5

Still though, no response from the Docker Cloud team, in conjunction with yesterday’s DNS outage makes it a priority for me to explore alternatives.


(Imjosh2) #6

I’m not sure what the difference is, but I’m not experiencing my resolv.conf being overwritten even after many days.