Page 1 of 1

NetworkManager updating resolv.cfg

Posted: 2018/06/13 05:49:03
by nupurpriya
Hi,

I am facing issue stoping NetworkManager to update resolv.cfg, I am using below configuration for eth0 interface:

TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=eth0
UUID=93b90a46-dab5-4a67-8fd0-fefe8874a8b9
DEVICE=eth0
ONBOOT=no
PEERDNS=no
PEERROUTES=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
DNS1=<ipv4 address>
DNS2=<ipv6 address>


Also, added dns=none in NetworkManager.conf file.

Whenever I am restarting NetworkManager, resolv.cfg gets updated and only ipv4 nameserver is displaced, whether I am expecting both the ips (ipv6 and ipv4 address to be present in resolv.cfg file.

Any suggestion here, how to achieve that??

Re: NetworkManager updating resolv.cfg

Posted: 2018/06/13 06:39:53
by TrevorH
You've got PEERDNS=no and IPV6_PEERDNS=yes. If you want it not to update that file then both will need to be no.

Re: NetworkManager updating resolv.cfg

Posted: 2018/06/13 07:33:42
by nupurpriya
Yes, I tried that option as well, but after setting IPV6_PEERDNS=no, NetworkManager stops coming up.

Re: NetworkManager updating resolv.cfg

Posted: 2018/06/13 08:07:32
by nupurpriya
Attached is the log file from the faulty server.

I noticed while restarting the NetworkManager for the first time after making relevant changes, everything works as required, resolv.cfg contained the entry for both DNS servers. But again restarting the service updated resolv.cfg, and DNS entry for ipv6 was erased.

I checked the logs, and found:
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 NetworkManager: <info> dhclient started with pid 26513
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 NetworkManager: <info> Activation (eth0) DHCPv6 will time out in 45 seconds
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 NetworkManager: <info> Activation (eth0) Stage 3 of 5 (IP Configure Start) complete.
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 NetworkManager: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) started...
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 NetworkManager: <info> Activation (eth0) Stage 4 of 5 (IP4 Configure Get) complete.
Jun 13 00:48:42 ccm-ipv6-01 daemon 6 dhclient: Internet Systems Consortium DHCP Client 4.1.1-P1

Does it have to do anything with the error?