[TriLUG] Ignoring certain DHCP options (specifically, DNS)

Steve Litt slitt at troubleshooters.com
Tue Feb 19 12:57:58 EST 2013


On Tue, 19 Feb 2013 10:43:32 -0500
Aaron Schrab <aaron at schrab.com> wrote:

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

LOL:

This is how I do it when I need to override Ubuntu's network wizardry.
Obviously Ken Mink's method is the right way, but chattr is so darn
easy, and also serves as a protest against Ubuntu's "we make everything
an inscrutable GUI" philosophy.

The next question is why I use Ubuntu. Simple: I'm a hypocrite.

:-)

SteveT



More information about the TriLUG mailing list