Linux-Noob Forums

Full Version: resolv.conf is overwritten on reboot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Just a quick tip:

 

For those using DHCP clients, you will proably find that on reboots that your resolv.conf is overwritten. To stop this from happening you can:

 

 

For dhcpcd its easy, add the option -R to your command line:



Code:
# dhcpcd -R




 

You will need to find the configuration file to edit and add this option to (differs per distro).

 

For dhcp-client there is a couple of options, the best, imho is to create a file "/etc/dhcp-enter-hooks":



Code:
# /etc/dhclient-enter-hooks

make_resolv_conf() {
     echo "doing nothing to resolv.conf"
}




 

 

Thats it... have fun,..

Nice tip znx :)
Thank you once again for resolving something for me that was a small irritation.