[TriLUG] Ignoring certain DHCP options (specifically, DNS)
Aaron Schrab
aaron at schrab.com
Tue Feb 19 10:43:32 EST 2013
At 09:57 -0500 19 Feb 2013, Brian Henning <bhenning at pineinst.com> wrote:
>So my question is: Is creating a dhclient.conf the only right solution
>to tell dhclient to ignore DNS info from DHCP and leave my resolv.conf
>alone?
The method I've used for a quick way to prevent dhclient from modifying
my resolv.conf file is to just run `chattr +i /etc/resolv.conf` as root.
This marks the file as being immutable, and will prevent even programs
running with root privileges from modifying it unless the immutable flag
is first removed, which can be done by simply substituting '-' for '+'
in the chattr command.
This does result in an error being displayed when the script started by
dhclient attempts to replace that file, but as far as I've been able to
tell it doesn't cause any actual problems.
More information about the TriLUG
mailing list