From owner-freebsd-questions Wed Apr 11 20: 7:56 2001 Delivered-To: freebsd-questions@freebsd.org Received: from gforce.johnson.home (24-240-126-221.hsacorp.net [24.240.126.221]) by hub.freebsd.org (Postfix) with ESMTP id D895337B43F for ; Wed, 11 Apr 2001 20:07:40 -0700 (PDT) (envelope-from glennpj@charter.net) Received: (from glenn@localhost) by gforce.johnson.home (8.11.3/8.11.3) id f3C36p204041; Wed, 11 Apr 2001 22:06:51 -0500 (CDT) (envelope-from glenn) From: Glenn Johnson Date: Wed, 11 Apr 2001 22:06:45 -0500 To: Leonard Zettel Cc: "freebsd-questions@FreeBSD.ORG" Subject: Re: resolv.conf overwrite Message-ID: <20010411220645.A3031@gforce.johnson.home> Mail-Followup-To: glenn@FreeBSD.ORG, Leonard Zettel , "freebsd-questions@FreeBSD.ORG" References: <3AD51271.25615AEB@acm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AD51271.25615AEB@acm.org>; from zettel@acm.org on Wed, Apr 11, 2001 at 10:26:57PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Apr 11, 2001 at 10:26:57PM -0400, Leonard Zettel wrote: > Following The Complete FreeBSD p 480 I created the following > /etc/resolv.conf > > # Changed by Len Zettel 4/11/01 > #----------removed------------- > # search > # nameserver 192.168.0.185 > # ------------------------------ > # ---------Added--------------- > domain Oz. > nameserver 204.254.120.6 # Bignet primary nameserver > nameserver 204.254.120.7 # Bignet secondart nameserver > #------------------------------------------------------ > > I was then happy as a clam at high tide at being able to ping domain > names on the net. :-) This looked like PROGRESS! (One step at a time > division). > > Then I rebooted :-( > > /etc/resolv.conf now contained > > search > nameserver 192.168.0.185 > > Tentative conclusion: something in the boot sequence is fooling with > (probably creating) /etc/resolv.conf > > So, what do I change to stop this? Or should I not be trying to stop > it? And doing something else entirely? And where can I read about > THAT? The DHCP server that is providing your IP address is doing that. To override that behavior you need to do the following while logged in as root: [1] Create a file called "/etc/dhclient-enter-hooks". For the case you describe the contents of this file should be: #!/bin/sh new_domain_name="Oz" new_domain_name_servers="204.254.120.6 204.254.120.7" [2] Make the "/etc/dhclient-enter-hooks" files executable by executing the command: chmod +x /etc/dhclient-enter-hooks [3] Restart dhclient. I am not sure what the cleanest way to do this is but stopping the daemon and restarting it should work. First you need to find the process ID and the command to restart it. Run the command ps ax | grep dhclient The output should look something like: 3800 ?? Is 0:00.00 dhclient de0 The first field is the process ID and the last two fields are what you need to restart the dhclient process, the very last field being the network interface. So the following command would work except you would substitute with the appropriate process ID and substitute de0 with whatever the appropriate interface is: kill 3800 && dhclient de0 Now if you look at /etc/resolv.conf it should be correct. -- Glenn Johnson glennpj@charter.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message