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

Ken Mink ken.mink at gmail.com
Tue Feb 19 13:27:26 EST 2013


On 2/19/13 12:57 PM, Steve Litt wrote:
> 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
I switched to using my own dhclient.conf when I got tired of the error 
messages caused by using chattr. It is easy and it does work.



More information about the TriLUG mailing list