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.