Resolv.conf

From wiki.filipefonseca.pt
Revision as of 23:31, 7 February 2022 by FilipeFonseca (talk | contribs) (Created page with "== Prevent DHCP client from changing resolv.conf file == This is the method that I recommend using the most. Edit <code>/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate</code>....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Prevent DHCP client from changing resolv.conf file

This is the method that I recommend using the most.

Edit /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate.

vim /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate

Make the following edits:

#!/bin/sh
make_resolv_conf(){
    :
}

Save and exit.

Update the permissions on the nodnsupdate file.

chmod +x /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate

Reboot your server. You can now update nameservers by editing /etc/resolv.conf without worrying about rollback.