I have an Oracle Linux 7.5 VM on VirtualBox setup with a static IP address. My DNS servers have changed since I first setup the VM. I modified the file
/etc/sysconfig/network-scripts/ifcfg-enp0s3 to have the IP address for the new DNS server but, when I reboot,
/etc/resolv.conf keeps getting recreated with the old DNS server ip addresses.
[root@oel72 ~]# cd /etc/sysconfig/network-scripts [root@oel72 network-scripts]# cat ifcfg-enp0s3 TYPE=Ethernet BOOTPROTO=static DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no NAME=enp0s3 UUID=58524328-dc73-4b1f-9a56-e3a5d5a4edd5 DEVICE=enp0s3 ONBOOT=yes IPV6_ADDR_GEN_MODE=stable-privacy DNS1=IPADDRESSOFNEWDNSSERVER DOMAIN="my domains edited for post" IPADDR=10.0.2.6 PREFIX=24 GATEWAY=10.0.2.2 IPV6_PRIVACY=no PROXY_METHOD=none BROWSER_ONLY=no
[root@oel72 ~]# cat /etc/resolv.conf # Generated by NetworkManager search my domains edited for post nameserver IPADDRESSOFOLDDNS1 nameserver IPADDRESSOFOLDDNS2 nameserver IPADDRESSOFOLDDNS3
I edited out the actual IP addresses and actual domain names. Hopefully that will not obscure the issue. I'm guessing that there is some command to make the system pull in
/etc/sysconfig/network-scripts/ifcfg-enp0s3 again and that it will store the IP address for the new DNS but I cannot find instructions for doing so. Does anyone know how to update these?