From owner-freebsd-questions Sun Mar 9 14:15:11 2003 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 21BF537B404 for ; Sun, 9 Mar 2003 14:15:09 -0800 (PST) Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1036343FB1 for ; Sun, 9 Mar 2003 14:15:08 -0800 (PST) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com[24.147.188.198]) by rwcrmhc53.attbi.com (rwcrmhc53) with ESMTP id <20030309221507053001tlcqe>; Sun, 9 Mar 2003 22:15:07 +0000 Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [24.147.188.198] (may be forged)) by be-well.ilk.org (8.12.8/8.12.7) with ESMTP id h29MF6Bc055289 for ; Sun, 9 Mar 2003 17:15:06 -0500 (EST) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: (from lowell@localhost) by be-well.ilk.org (8.12.8/8.12.6/Submit) id h29MF5xm055286; Sun, 9 Mar 2003 17:15:05 -0500 (EST) X-Authentication-Warning: be-well.ilk.org: lowell set sender to freebsd-questions-local@be-well.ilk.org using -f To: freebsd-questions@freebsd.org Subject: Re: DHCP Server "learning" name servers since server itself is dhcp'd?? References: <20030308102434.M6374-100000@diana.northnetworks.ca> From: Lowell Gilbert Date: 09 Mar 2003 17:15:05 -0500 In-Reply-To: <20030308102434.M6374-100000@diana.northnetworks.ca> Message-ID: <44zno4426u.fsf@be-well.ilk.org> Lines: 50 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 IAccounts writes: > > > Alternatively is there a way to dynamically tell BIND to get it's > > > forwarders list from /etc/resolv.conf? > > > > This could be done pretty much the same way. I thought I'd done it on > > my system, but as I look at named.conf, I don't seem to have ever > > finished the shell script to auto-generate the named.conf file. > > Bind 8 doesn't have a sufficiently powerful include mechanism to do > > this neatly. > > I would be very interested in helping (or starting) some development for > this purpose. I already have created a perl script for generating zone > files and updating serial numbers, but give me until the beginning of the > workweek, and I can do this. > > Very interesting concept that I would happily put forth time to develop. > Mail me off list with any other details that you would like considered. Oh, wait a minute. I *did* have it working already. I put the line #include "forwarders-list" into the options section of my named.conf, and I have my dhclient-enter-hooks script build that forwarders-list file, and run named.conf through the C preprocessor to handle the file inclusion. dhclient-enter-hooks looks like this: #!/bin/sh file=/etc/namedb/forwarders-list if [ x"$new_domain_name_servers" != x ]; then echo ' forwarders {' > $file for n in $new_domain_name_servers ; do if [ "${n}" != "127.0.0.1" ] ; then echo " ${n};" >> $file fi done echo " };" >> $file fi cpp -P -C /etc/namedb/named.conf > /etc/namedb/named.usable.conf ndc reload The only other thing is that named has to be told to use the rebuilt version, so I specify that in rc.conf, with named_flags="-u bind -g bind -c /etc/namedb/named.usable.conf" # Flags for named To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message