configuration for different networks

Sten Carlsen sten at s-carlsen.dk
Thu Jul 26 19:07:18 UTC 2007



Jared Greenwald wrote:
> On 7/26/07, Sten Carlsen <sten at s-carlsen.dk> wrote:
>   
>> You probably want to check the man pages for "dhclient-enter-hooks".
>>
>> I have in my dhclient-enter-hooks:
>> #  /etc/dhclient-enter-hooks
>> #  This file should stop some of the damage done by dhclient.
>>
>> function make_resolv_conf() { return; }
>>
>>
>>
>> The function "make_resolv_conf()" replaces the built-in function that
>> writes out a new resolv.conf when receiving the packet from the server.
>>
>>     
> I see what you're trying to do, but what I don't get is why not just
> get rid of the appropriate entries from the request line in the
> dhclient.conf (domain-name-servers, time-offset)?  Also, does this
> configuration help you when you first boot up?  How do you get the
> initial configuration if you happen to be on a different network?
>   
What it really buys me is an opportunity to write the resolv.conf the
way I want it to be. You could start from a copy of the original script,
you can find it in /sbin/dhclient-script (at least in my version). There
you can see exactly what information is available and how it is used.

If you want to preserve the search list, you could have a copy of it in
another file and copy that to the new resolv.conf instead of the line
now in the script. You have all possibilities that you can fit into a
shell script e.g.  logging, writing other files, starting other
programs, ...

In my case I wanted to keep resolv.conf exactly as I had originally
written it, so I put in an empty script,, that would not change my
resolv.conf.
> Thanks,
> Jared
>
>   

-- 
Best regards

Sten Carlsen

No improvements come from shouting:

       "MALE BOVINE MANURE!!!"


More information about the dhcp-users mailing list