NetworkManager, dns= and resolv.conf override



Hello Thomas, Hello everybody,

In short : in a setup where I don't state any 'dns=' NM directive, I don't understand why /etc/resolv.conf (file, not symlink) is not overriden.

I'm running CentOS-8.1 on HPC compute nodes provisionned by the xCAT software.
Basically nodes PXE-boot and download a stateless CentOS-8.1 image.

xCAT provides a so called 'postscript' mechanism (called confignetwork -s) to turn the dynamically (DHCP) assigned node's ip address into a static ip address. It does this by creating an additionnal NM profile with higher autoconnect priority.

for instance :

- profile initially retrieved by PXE/DHCP :

# cat /etc/sysconfig/network-scripts/ifcfg-enp33s0f0
DEVICE=enp33s0f0
BOOTPROTO=dhcp
HWADDR=ac:1f:6b:c8:ee:16
ONBOOT=yes

- higher priority profile after xCAT 'confignetwork -s' script is run :

# cat /etc/sysconfig/network-scripts/ifcfg-xcat-enp33s0f0
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
IPADDR=192.168.152.3
PREFIX=20
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=xcat-enp33s0f0
UUID=9de3e814-a286-44e9-b66d-3cc14694d808
DEVICE=enp33s0f0
ONBOOT=yes
AUTOCONNECT_PRIORITY=9
MTU=1500

# Expected and working behavios :

What I experienced is that first the node gets via DHCP, as expected, a working /etc/resolv.conf file and then after xCAT confignetwork -s postscript is run, the new profile is loaded and up but /etc/resolv.conf is empty as, as can be seen above, the profile does not provide any dns properties.

I worked around this by adding 'dns=none' in a NetworkManager .conf file. And it worked : the /etc/resolv.conf file initially written by DHCP was left untouched.

# Unexpected and unexplained behavior :

What I don't understand is that, then if I manually remove the 'dns=none' setting and either restart NM and/or reload+reactivate the profile, /etc/resolv.conf is not, as I was expecting, emptied by NM.

Can you help me figure out what I am missing ?

Thanks for your help

--
Thomas HUMMEL


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]