Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 07 Dec 2001 09:46:38 -0800
From:      "Kevin Oberman" <oberman@es.net>
To:        "Brian T.Schellenberger" <bts@babbleon.org>
Cc:        Edwin Groothuis <edwin@mavetju.org>, Todd Hansen <tshansen@nlanr.net>, questions@FreeBSD.ORG
Subject:   Re: resolv.conf 
Message-ID:  <200112071746.fB7Hkcd31584@ptavv.es.net>
In-Reply-To: Your message of "Thu, 06 Dec 2001 15:41:38 EST." <01120615413800.00533@i8k.babbleon.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> From: "Brian T.Schellenberger" <bts@babbleon.org>
> Date: Thu, 6 Dec 2001 15:41:38 -0500
> Sender: owner-freebsd-questions@FreeBSD.ORG
> 
> On Thursday 15 November 2001 20:47, Edwin Groothuis wrote:
> > On Thu, Nov 15, 2001 at 05:43:49PM -0800, Todd Hansen wrote:
> > > is there a way to specify the search domains for my DNS resolving. I use
> > > DHCP and as such each time I boot my laptop in a new location the
> > > resolv.conf file gets overwritten. Is there another place I can specify
> > > the search domains so that I don't have to use the full domain name?
> >
> > You can prevent your resolv.conf to be (completly/partly) overwritten
> > if you use dhclient.conf correctly.
> 
> Sorry for replying to such an old post, but . . .
> 
> An alternative which you may find useful is to supplement the run-time 
> behavior.  If you redefine the make_resolv_conf() function of dhclient in the 
> /etc/dhclient-enter-hooks file, then you can "grab" the info that the DHCP 
> server sent.  I do this myself because I don't want my /etc/resolv.conf 
> overwritten: I run a local nameserver and I always want to use it, but it's 
> nice to stuff away the DHCP-server supplied version of that file because if 
> my upstream nameservers change then I can easily see how I need to update my 
> named.conf file.  In my case they change quite rarely so my function is 
> rather simplistic, and if my nameservers breaks I have to update it's config 
> file by hand, but it would be easy to take this idea further and completely 
> automate the process by having the dhclient process automatically update the 
> named.conf file.

While this is entirely correct, I'm not sure why you don't just use
the standard parameters is dhclient.conf to do this.

To avoid changes, use the supersede, prepend, append, and default
statements to ignore or adjust the DNS (and other) values supplied by
DHCP.

From my dhclient.conf (with the addresses changed):

interface "wi0" {
	  send dhcp-client-identifier "jinx";
	  send host-name "jinx";
	  prepend domain-name-servers 198.1.2.3, 128.3.2.1;
	  supersede domain-name "my-domain.com";
}

R. Kevin Oberman, Network Engineer
Energy Sciences Network (ESnet)
Ernest O. Lawrence Berkeley National Laboratory (Berkeley Lab)
E-mail: oberman@es.net			Phone: +1 510 486-8634

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112071746.fB7Hkcd31584>