Configuring NetworkManager to use systemd-resolved without dnsmasq in 17.04

Tom H tomh0665 at gmail.com
Mon Jul 31 19:59:44 UTC 2017


On Mon, Jul 31, 2017 at 2:33 PM, Oleg Andriyanov <o.andriyanov at gmail.com> wrote:
>
> Hello! I have some questions regarding name resolution system in 17.04.
>
> After upgrading to 17.04 from 16.04 I can't figure out how host name
> resolution system is meant to be configured. First, I've noticed that after
> upgrade search domains have disappeared from /etc/resolv.conf. They came
> back once I've removed /etc/resolv.conf symlink and restarted
> NetworkManager. But then the contents became as follows:
>
> # Generated by NetworkManager
> search mydomain1 mydomain2
> nameserver 127.0.1.1
>
> Ok, search domains are there. But why nameserver 127.0.1.1 is there? No
> process is listening on that address, hence the name resolution doesn't
> work.
>
> AFAIK, 127.0.1.1 is the hard-coded listen address of dnsmasq, which is not
> configured in /etc/NetworkManager/NetworkManager.conf:
>
> [main]
> plugins=ifupdown,keyfile
>
> [ifupdown]
> managed=false
>
> [logging]
> level=DEBUG

Ubuntu patches the NM source to call dnsmasq with "--listen-address=127.0.1.1".


> Actually, dnsmasq wasn't even installed after upgrade. After installing
> dnsmasq and adding the line dns=dnsmasq into NetworkManager.conf, everything
> works well, but I wonder if I am doing something wrong, or is it a bug in
> NetworkManager or somewhere else.
>
> So my questions are, is it possible to use systemd-resolved instead of
> dnsmasq? If not, what is the purpose of moving to systemd-resolved?

In the 17.10 version of NM, you can set "dns=systemd-resolved" in
"/etc/NetworkManager/NetworkManager.conf".

If you can't do this on 17.04 (check "man NetworkManager.conf"), you can:

1) Set "dns=none" in "/etc/NetworkManager/NetworkManager.conf"

2) Set "DNS=ip_address_of_your_dns_server" (or
"DNS=space-separated_ip_addresses_of_your_dns_servers") in
"/etc/systemd/resolved.conf"

3) Run "systemctl enable systemd-resolved.service" (if it isn't enabled).

4) Either set "nameserver 127.0.0.53" in "/etc/resolv.conf" or ensure
that "/etc/resolv.conf" is a symlink to
"/run/systemd/resolve/resolv.conf".




More information about the ubuntu-users mailing list