I tried changing DNS servers in “Hostname and DNS Client” to add in an extra 2 (Googles) for backup (because Linode DNS went down earlier), BUT when I Apply the changes, and go back in its reset them back to the original ones. This only happens on some of my virtualmin servers.
Does anyone know why the DNS servers keep resetting back??
But I am a little confused as to what I should change to stop resolv.conf overwriting. The link you sent is mainly instructions about adding 127.0.0.1 to a /etc/dhclient.conf file. I guess thats not my issue?
Some of my servers overwrite resolv.conf and some dont which is weird. I can see eth0 differences as follows, should I change eth0 as per the Linode static network guide??
One way to correct it would be just to change it to use static IP’s. We recommend static IP’s when possible.
If you wish to use DHCP, the instructions mentioned in that link are what you’re after… except, instead of “127.0.0.1” as your DNS server, you’d replace that with your desired nameserver’s IP address.
Thanks, but to use static IPs I just change the eth0 file to like the second one above? I think thats my issue, I dont actually know what to change. I guess making the eth0 like the second one above would work, as I am sure thats all I did on the servers that do have static.
You could either make the change from within Webmin/Virtualmin (by going into Webmin -> Networking -> Network Configuration -> Network Interfaces), or you could use a text editor to change the interface file that you’re looking at… the CentOS documentation for that is available here:
Thanks for that, but when I changed it in Network Configuration -> Network Interfaces the server went down :(. Had to login to the Linode console and set it manually like the above eth0 config like another static server and worked OK. So a bit reluctant to do it in Webmin. Will do the others by command. Revisiting Networking Interfaces it looks the same as what I entered. I dont have the eth0 file anymore to show you what it looked like.
any one wondering about this on openvz, you can edit your resolv.conf and then use chattr +i on it to make it read only even to root, i had to do the same thing to my /etc/hostname