From owner-freebsd-questions Fri Dec 7 9:46:50 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ptavv.es.net (ptavv.es.net [198.128.4.29]) by hub.freebsd.org (Postfix) with ESMTP id 372B937B405 for ; Fri, 7 Dec 2001 09:46:45 -0800 (PST) Received: from ptavv.es.net (localhost [127.0.0.1]) by ptavv.es.net (8.10.1/8.10.1) with ESMTP id fB7Hkcd31584; Fri, 7 Dec 2001 09:46:38 -0800 (PST) Message-Id: <200112071746.fB7Hkcd31584@ptavv.es.net> To: "Brian T.Schellenberger" Cc: Edwin Groothuis , Todd Hansen , questions@FreeBSD.ORG Subject: Re: resolv.conf In-reply-to: Your message of "Thu, 06 Dec 2001 15:41:38 EST." <01120615413800.00533@i8k.babbleon.org> Date: Fri, 07 Dec 2001 09:46:38 -0800 From: "Kevin Oberman" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: "Brian T.Schellenberger" > 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