1

Note: My question is not how to stop nm updating /etc/resolv.conf. Not how to make openconnect work. Instead I just want to understand some details about resolv.conf configuring in ubuntu. Why there are two ways to configure it (/etc/resolv.conf is symlink to /run/resolvconf/resolv.conf or /var/run/NetworkManager/resolv.conf), why I get different configurations and why sometimes I have running DNS server on 127.0.1.1 and sometimes I do not.

I'm using xubuntu version 17.04. And I need to connect to pulse secure (5.3r1 now) VPN. Previously this VPN product was named Junos Pulse by the Juniper Networks. Now I have several options to connect to this VPN:

  1. Pulse Secure 5.3r1 - which is provided by our service provider. And contains 32bit GUI that requires a lot of 32bit libraries.
  2. Use openconnect --juniper
  3. Create VPN connection through the Network Manager (Juniper/Pulse Network Connect type). Juniper support was added into Network Manager recently and is provided by the network-manager-openconnect-gnome package.

But I have some troubles with DNS configuring during connecting to VPN. I didn't change anything and seems that now systemd-resolve is used. According to systemd-resolve documentation it manages /etc/resolv.conf as a link to /run/resolvconf/resolv.conf file and that file should contain "nameserver 127.0.0.53". New nameservers and default domain names can be added to this file and in that case all nameservers are used. In that case everything works.

But after reboot sometimes I see that /etc/resolv.conf points to /var/run/NetworkManager/resolv.conf and contains lines "# Generated by NetworkManager" and "nameserver 127.0.1.1". In that case name resolution for my VPN doesn't work.

So the question is what is 127.0.1.1 DNS server, why I have two DNS servers instead of one. Actually I don't need local DNS server at all, but anyway. Why /etc/resolv.conf link is set to /var/run/NetworkManager/resolv.conf by the Network Manager.

I just checked netstat -utlp:

Proto Local Address           Program name
tcp   0.0.0.0:5355 (hostmon)  systemd-resolved
udp   127.0.0.53:53(domain)   systemd-resolved
udp   0.0.0.0:5353 (mdns)     chrome
udp   0.0.0.0:5353 (mdns)     avahi-daemon
udp   0.0.0.0:5355 (hostmon)  systemd-resolved

I checked systemd-resolve --status:

Global
     DNS Servers: 127.0.1.1
...

I checked network config /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile

[ifupdown]
managed=false

And I don't have dnsmasq installed.

PS: seems that Network Manager installs that link on behalf of resolvconf. Need to check. But still don't understand why it is so if systemd-resolve is installed. Why systemd-resolve is not used for that.

PSS: Just found there are two separate services in ubuntu: resolvconf.service (from resolvconf package) described in /lib/systemd/system/resolvconf.service. And systemd-resolved.service (from systemd package) described in /lib/systemd/system/systemd-resolved.service. Quick googling didn't give me an answer why there are two services that do the same job and are part of core ubuntu and can't be even uninstalled.

  • You're looking for this: https://askubuntu.com/questions/623940/network-manager-how-to-stop-nm-updating-etc-resolv-conf. – fosslinux May 26 '17 at 03:10
  • 2
  • That topic answers the question "How to prevent Network Manager from updating my /etc/resolv.conf". I don't need that. I want something to configure my DNS based on DHCP initially. And then updates DNS configuration appropriately during connecting to VPN. My question is why Network Manager creates symlink /etc/resolv.conf -> /var/run/NetworkManager/resolv.conf, why it doesn't create symlilnk to /run/resolvconf/resolv.conf. Who can be responsible for creating symlink. Who manages that file. – Pavel Moukhataev May 26 '17 at 12:08
  • Same topic with no answer https://askubuntu.com/questions/873060/systemd-resolved-resolvconf-service-resolvconf-and-openresolv-why-which-and – Pavel Moukhataev May 26 '17 at 12:12
  • 1
    This is a very well known bug: https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1211110 A person has suggested a fix in the comments there, could you try that? – Andrea Lazzarotto May 29 '17 at 20:24

0 Answers0