aacebedo / dnsdock

DNS service discovery for Docker containers
MIT License
608 stars 91 forks source link

Ubuntu 16.04 and dnsmasq #72

Open TEHEK opened 8 years ago

TEHEK commented 8 years ago

While trying to set up dnsdock on ubuntu 16.04 i discovered that 16.04 has default system configured in such a way that network manager is using dnsmasq running on local ip address (in my case it's 127.0.1.1 and port 53).

While editing the /etc/resolv.conf works until the machine restarts (or config is overwritten by any other means), i found that one can also configure dnsmasq to use the dnsdock only for .docker domains by creating a file /etc/NetworkManager/dnsmasq.d/local-docker.conf with

server=/docker/172.17.0.1

while running dnsdock as dnsdock -dns="172.17.0.1:53" (since 127.0.1.1:53 is taken by dnsmasq).

The difference is that the DNS for non-docker domains remains under the NetworkManager's control and there will be no need to amend /etc/resolv.conf on every restart. Whether that is a pro or a con, it's up to you :)

aacebedo commented 8 years ago

Hi

Thank you for the info, I'll update the Readme about this.

Regards

TEHEK commented 8 years ago

Thanks for the reply :)

Just checked, Ubuntu 14.04 uses dnsmasq as well.

On the other hand, turns out it's not a replacement for editing /etc/resolv.conf inside the docker containers running ubuntu

TEHEK commented 8 years ago

And thanks for taking care of the project :+1:

aacebedo commented 8 years ago

You're welcome

Running Ubuntu in containers is not recommended. Systemd has issues with this. For dnsdock I recommend using the rockerfile based on alpine.