Date: 09 Mar 2003 17:15:05 -0500 From: Lowell Gilbert <freebsd-questions-local@be-well.no-ip.com> To: freebsd-questions@freebsd.org Subject: Re: DHCP Server "learning" name servers since server itself is dhcp'd?? Message-ID: <44zno4426u.fsf@be-well.ilk.org> In-Reply-To: <20030308102434.M6374-100000@diana.northnetworks.ca> References: <20030308102434.M6374-100000@diana.northnetworks.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
IAccounts <iaccounts@northnetworks.ca> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44zno4426u.fsf>
