Refactored dns::server class.
This commit is contained in:
parent
34be570ebc
commit
4cb660dcaf
7 changed files with 155 additions and 121 deletions
58
dns/templates/generate-named-conf.sh.erb
Normal file
58
dns/templates/generate-named-conf.sh.erb
Normal file
|
@ -0,0 +1,58 @@
|
|||
#!/bin/sh
|
||||
|
||||
chroot="<%= chroot %>"
|
||||
confdir="<%= confdir %>"
|
||||
operatingsystem="<%= operatingsystem %>"
|
||||
|
||||
cat <<EOF
|
||||
include "${confdir}/named.conf.local";
|
||||
include "${confdir}/named.conf.options";
|
||||
|
||||
view default {
|
||||
match-clients { any; };
|
||||
EOF
|
||||
|
||||
for name in ${chroot}${confdir}/zone.* ; do
|
||||
echo " include \"${confdir}/`basename ${name}`\";"
|
||||
done
|
||||
|
||||
case $operatingsystem in
|
||||
OpenBSD)
|
||||
cat <<EOF
|
||||
zone "." {
|
||||
type hint;
|
||||
file "/etc/root.hint";
|
||||
};
|
||||
zone "localhost" {
|
||||
type master;
|
||||
file "/standard/localhost";
|
||||
};
|
||||
zone "127.in-addr.arpa" {
|
||||
type master;
|
||||
file "/standard/loopback";
|
||||
};
|
||||
zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" {
|
||||
type master;
|
||||
file "/standard/loopback6.arpa";
|
||||
};
|
||||
EOF
|
||||
;;
|
||||
Ubuntu)
|
||||
echo " include \"${confdir}/named.conf.default-zones\";"
|
||||
;;
|
||||
*)
|
||||
cat <<EOF
|
||||
|
||||
zone "." {
|
||||
type hint;
|
||||
file "/var/named/named.ca";
|
||||
};
|
||||
|
||||
EOF
|
||||
cat ${chroot}/etc/named.rfc1912.zones | \
|
||||
sed -e 's%file "%file "/var/named/%' -e 's/^/ /'
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "};"
|
||||
echo ""
|
Loading…
Add table
Add a link
Reference in a new issue