Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: DHCP client overwriting resolv.conf how to stop it on linux.  (Read 2131 times)

0 Members and 1 Guest are viewing this topic.

Aby

  • Guest
DHCP client overwriting resolv.conf how to stop it on linux.
« on: January 22, 2014, 10:51:46 pm »
DHCP client overwriting resolv.conf how to stop it on linux

Prevent resolv.conf updates only, the fastest way is to redefine the function to do nothing:
create flowing file 

# cat /etc/dhclient-enter-hooks
make_resolv_conf() {
exit 0
}


Then save the file and ensure it is executable:

# chmod a+x /etc/dhclient-enter-hooks

Note that, as explained in the man page, the dhclient-script is not standard so if this configuration doesn’t work, please read the man page.