Can bind read resolv.conf for forwarders?
Kevin Darcy
kcd at daimlerchrysler.com
Mon Feb 24 19:16:21 UTC 2003
Richard Miller wrote:
>A quick question I cannot find an answer to. I'm running RH Linux 7.1 and
>bind 9.2.1 as a caching only nameserver on a small home network. I recently
>go a DSL connection and am using rp-pppoe. My isp (Covad/ATT) occasionally
>assigns new name servers when my connection restarts. RP-PPPOE then
>rewrites my resolv.conf and all works fine, EXCEPT now my forwarders listed
>in named.conf are incorrect and this seems to cause a noticeable delay in
>DNS resolution. I'm not a Linux guru capable of writing shell scripts to
>read the resolv file and update my bind configuration. Just wondering if
>there is an easy fix to this. Thanks. Richard
>
Quick and dirty (you'd certainly want to add some sanity checks and/or
error recovery to this):
> BEGIN { print "forwarders { "; }
> print if (s/^nameserver[\s]+(.*)\n$/$1; /);
> END { print "};\n"; }
Invoke as "perl -n {path-to-script} /etc/resolv.conf". Then just
"include" the output of that script into your named.conf. You'd have to
include the generation of this include-file into your network startup
scripts, of course.
Or, as was already suggested, don't bother using forwarders at all...
- Kevin
More information about the bind-users
mailing list