I have a server that doesn't update resolv.conf correctly when networking is restarted. This is a red hat 7 server. It should use the nameservers from dhcp. I checked /var/lib/dhclient/dhclient--eth0.lease
and there is a line option domain-name-servers
which has the correct servers to use.
ifcfg-eth0 looks like this:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=dhcp
IPV6INIT=no
MTU=1500
TYPE=Ethernet
NM_CONTROLLED=no
PERSISTENT_DHCLIENT=yes
Everything I've read suggests this should be simple and just work. I dont think network manager is a problem. I tried sudo systemctl stop NetworkManager
and got a message saying the service is not loaded. I added PEERDNS=yes, which defaults to yes any way and made no difference. It's still overwritten with an empty file
$ cat /etc/resolv.conf
options rotate timeout:1
I'm not sure what else I could check.