What is the best approach to keep dhclient from overwriting /etc/resolv.conf every time it gets a new lease on an IP address? This has been a frustrating search as Google has turned up next to nothing on the issue other than a hack into a script file which should be overwritten when world is rebuilt. Thanks in advance, Tom Veldhouse
Thomas T. Veldhouse wrote:> What is the best approach to keep dhclient from overwriting > /etc/resolv.conf every time it gets a new lease on an IP address?Perhaps: chflags schg /etc/resolv.conf> This has been a frustrating search as Google has turned up next to nothing on > the issue other than a hack into a script file which should be > overwritten when world is rebuilt.Changing /etc/dhclient.conf would not be overwritten just because you do a buildworld, but you would need to pay attention when using mergemaster. -- -Chuck
On 05/06/2006 14:24, Thomas T. Veldhouse wrote:> What is the best approach to keep dhclient from overwriting > /etc/resolv.conf every time it gets a new lease on an IP address? This > has been a frustrating search as Google has turned up next to nothing on > the issue other than a hack into a script file which should be > overwritten when world is rebuilt.If I'm getting your question right - isn't 'supersede' option in dhclient.conf(5) what you want? Something like: interface "int0" { supersede domain-name "example.com" supersede domain-name-servers "127.0.0.1" } HTH, Karol> Thanks in advance, > > Tom Veldhouse-- Karol Kwiatkowski <freebsd at orchid dot homeunix dot org> OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 250 bytes Desc: OpenPGP digital signature Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060605/5250066a/signature.pgp
> What is the best approach to keep dhclient from overwriting > /etc/resolv.conf every time it gets a new lease on an IP address?in /etc/dhclient.conf add a couple of lines: supersede domain-name "mydomain"; supersede domain-name-servers 192.168.3.1; replacing as appropoiate...> has been a frustrating search as Google has turned up next to nothing'man dhclient' would have been a better starting point :-) -pcf.
On Mon, 5 Jun 2006, Thomas T. Veldhouse wrote: hi, this is not the correct list to ask, but anyway. "man dhclient.conf" would learn you to use supersede and prepend statements. interface "xl0" { supersede domain-name "yourdomainname.com"; prepend domain-name-servers www.xxx.yyy.zzz; } adjust xl0 to your dhclient interface, yourdomain is search first for hostname lookups xyz is prefered first nameserver in the resolv.conf> What is the best approach to keep dhclient from overwriting /etc/resolv.conf > every time it gets a new lease on an IP address? This has been a frustrating > search as Google has turned up next to nothing on the issue other than a hack > into a script file which should be overwritten when world is rebuilt.grtz patrick