After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787378 - invalid resolv.conf when using dns=systemd-resolved
invalid resolv.conf when using dns=systemd-resolved
Product: NetworkManager
Classification: Platform
Component: IP and DNS config
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Reported: 2017-09-06 17:25 UTC by Sven
Modified: 2017-09-07 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---

Description Sven 2017-09-06 17:25:12 UTC
When setting dns=systemd-resolved, then /etc/resolv.conf should include the line "nameserver". But on my system, the line is "nameserver" instead. That won't work, cause systemd-resolved's DNS Stub Listener only listens on E.g. virtualbox stopped working because of this.

See for reference.

I'm using NetworkManager 1.8.2 on Gentoo.
Comment 1 Thomas Haller 2017-09-07 13:16:20 UTC
Does that mean, resolved never listens on, but if you optionally configure DNSStubListener=, then it will listen on

In that case, it sounds like that NM should indeed always configure

I think the workarounds are:

  (1) configure rc-manager=unmanaged and write /etc/resolv.conf yourself
    however you like. See `man NetworkManager.conf`.

  (2) configure rc-manager=symlink (this should already be the default), and
    replace /etc/resolv.conf with a symlink to /usr/lib/systemd/resolv.conf

I think (2) is preferred. Indeed, if you 

  - omit both "dns=" an "rc-manager=" settings in NetworkManager.conf
  - make /etc/resolv.conf a symlink to /usr/lib/systemd/resolv.conf

it should just work without additional configuration.
Comment 2 Sven 2017-09-07 13:24:39 UTC
systemd-resolved never listens on If the stub listener is enabled (it is enabled by default), then it listens on and only. As far as I can see, the address cannot be changed. In other words: it's not possible have resolved listen on any address other than

I agree that NM should always configure if dns=systemd-resolved.
Comment 3 Thomas Haller 2017-09-07 13:36:35 UTC
Should be fixed on master with:

Thanks for reporting!

What I meant in comment 1 maybe wasn't very clear. Let me try again:

AFAIU it's advised that you symlink /etc/resolv.conf to /usr/lib/systemd/resolv.conf. That way you indicate to resolved that it is the default resolver.

If you further leave dns= and rc-manager= unset (rc-manager should default to "symlink", depending on NM's compile time defaults), then NM will automatically understand to use resolved and not touch /etc/resolv.conf.

So, all you really need to do is set the symlink and don't configure anything in NM.