## Copyright (c) 1996, 1997 by Internet Software Consortium
##
## Permission to use, copy, modify, and distribute this software for any
## purpose with or without fee is hereby granted, provided that the above
## copyright notice and this permission notice appear in all copies.
##
## THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
## ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
## OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
## CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
## DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
## PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
## ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
# This is a filter. Input is a named.boot. Output is a named.conf.
# (named.boot was the old-style configuration file used with BIND-4. If
# you already have such a file for your site, you can run it through this
# script to convert it to the named.conf config file used by BIND-8)
print "// generated by named-bootconf.pl\n\n";
if ($have_options) {
print "options {\n";
foreach $option (sort(keys(%options))) {
print "\t$option $options{$option};";
if ($options_comments{$option} ne "") {
print "\t$options_comments{$option}";
}
print "\n";
}
if (@transfer_acl > 0) {
print "\tallow-transfer {\n";
for ($i = 0; $i <= $#transfer_acl; $i++) {
&print_maybe_masked("\t\t", $transfer_acl[$i],
$transfer_comments[$i]);
}
print "\t};\n";
}
print "\t/*
\t * If there is a firewall between you and nameservers you want
\t * to talk to, you might need to uncomment the query-source
\t * directive below. Previous versions of BIND always asked
\t * questions using port 53, but BIND 8.1 uses an unprivileged
\t * port by default.
\t */
\t// query-source address * port 53;
";
print "};\n\n";
}
if ($logging ne "") {
print "logging {\n$logging};\n\n";
}
if (@topology > 0) {
print "// Note: the following will be supported in a future release.\n";
print "/*\n";
print "host { any; } {\n\ttopology {\n";
for ($i = 0; $i <= $#topology; $i++) {
&print_maybe_masked("\t\t", $topology[$i],
$topology_comments[$i]);
}
print "\t};\n};\n";
print "*/\n";
print "\n";
}
if (@bogus > 0) {
for ($i = 0; $i <= $#bogus; $i++) {
print "server $bogus[$i] { bogus yes; };$bogus_comments[$i]\n";
}
print "\n";
}
print $new_config;
exit 0;
sub maybe_print_comment {
$prefix = shift;
$suffix = shift;
if ($comment ne "") {
$new_config .= sprintf("%s%s%s", $prefix, $comment, $suffix);
}
}