Subject: Re: dhclient erases(!?) /etc/resolv.conf (fwd)
To: Richard Rauch <rauch@rice.edu>
From: Mipam <mipam@ibb.net>
List: netbsd-help
Date: 04/01/2002 22:14:31
On Sun, Mar 31, 2002 at 06:50:03PM -0600, Richard Rauch wrote:
> I decided to try running dhclient on my laptop in a different environment
> today.  I was disturbed to discover that dhclient appears to have
> oblitterated my old /etc/resolv.conf (rather blindly), and did not restore
> it after I did a ``dhclient -r''.
> 
> Is this an intended feature, or was it just that no one considered that
> someone might sometimes use DHCP and sometimes use a static config?

Well, i guess it's intended.
In /sbin/dhclient-script (or /etc/....):

RESOLV=/etc/resolv.conf

make_resolv_conf() {
        if [ \( ! -z "$new_domain_name" \) -a \
	     \( ! -z "$new_domain_name_servers" \) ]; then
	     echo search $new_domain_name > $RESOLV
	     for nameserver in $new_domain_name_servers; do
		     echo nameserver $nameserver
	     done >> $RESOLV
        fi
}

Bye,

Mipam.