From owner-freebsd-questions@FreeBSD.ORG Sat Nov 13 05:47:55 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7425516A4CE for ; Sat, 13 Nov 2004 05:47:55 +0000 (GMT) Received: from ms-smtp-01-eri0.southeast.rr.com (ms-smtp-01-lbl.southeast.rr.com [24.25.9.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id D942443D53 for ; Sat, 13 Nov 2004 05:47:54 +0000 (GMT) (envelope-from gonesurfing@nc.rr.com) Received: from nicoya.surfbbx (rdu26-67-196.nc.rr.com [66.26.67.196]) iAD5lpKj009037; Sat, 13 Nov 2004 00:47:51 -0500 (EST) From: Eric Thornton To: Andrew Smith In-Reply-To: <030e01c4c941$57333f10$19c8a8c0@loriandsmith> References: <31173C0B4EF5D611A021009027CB2CBD0A78FF3F@fl08exm04> <419598F0.9000506@trini0.org> <030e01c4c941$57333f10$19c8a8c0@loriandsmith> Content-Type: text/plain Date: Sat, 13 Nov 2004 00:47:37 -0500 Message-Id: <1100324857.20355.8.camel@nicoya.surfbbx> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine cc: freebsd-questions@freebsd.org Subject: Re: DHCP & nameservers X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Nov 2004 05:47:55 -0000 On Sat, 2004-11-13 at 00:26 -0500, Andrew Smith wrote: > I'm using my FreeBSD box as the gateway machine for my cable modem. > Obviously the cable modem side has to be set as DHCP, which automaticlly > sets the DNS nameservers in resolve.conf. > > However I am running a caching name server on the box, and would like to > have resolve.conf only point to local host. Is there any way to keep DHCP > from updating resolve.conf? > > Thanks in advance, > > Andrew To keep dhclient from updating /etc/resolv.conf, create a file called /etc/dhclient-enter-hooks with the contents #!/bin/sh make_resolv_conf() { } If you want to point your cache at a list of upstream servers you can put dhclient info in a file for use by your server. I have the following in my enter hooks so that dnscache (djbdns) can use the info instead of going to root servers every time. #!/bin/sh #This script will update dnscache forwarders list make_resolv_conf() { if [ x"$new_domain_name_servers" != x ]; then rm /etc/dnslist for nameserver in $new_domain_name_servers; do echo $nameserver >> /etc/dnslist done fi } Hope this helps. Eric