Difference between revisions of "Resolv.conf"

From wiki.filipefonseca.pt
Jump to navigation Jump to search
(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>....")
 
m
 
Line 1: Line 1:
== Prevent DHCP client from changing resolv.conf file ==
== Prevent DHCP client from changing resolv.conf file ==
This is the method that I recommend using the most.
This is the method that I recommend using the most. changing dhcp hooks


Edit <code>/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate</code>.
Edit <code>/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate</code>.
  <code>vim /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate</code>
  <code>vi /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate</code>
Make the following edits:
Make the following edits:
  <code>#!/bin/sh
  <code>#!/bin/sh

Latest revision as of 09:36, 11 February 2022

Prevent DHCP client from changing resolv.conf file

This is the method that I recommend using the most. changing dhcp hooks

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

vi /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.