#
# Copyright (C) 2013, 2016 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
. ../conf.sh
ttl=300
IFS="${IFS}."
set $1
esac
esac
}
IFS="${IFS}."
set $1
shift
while [ $# -ne 0 ]
do
printf %s ${1}
shift
printf %s ${1:+.}
done
}
echo 'options {'
echo ' port 5300;'
echo " listen-on { $1; };"
echo " query-source $1;"
echo " notify-source $1;"
echo " transfer-source $1;"
echo ' key-directory "keys";'
echo " recursion ${2:-no};"
echo ' pid-file "pids/'"${addr}"'.pid";'
echo ' blackhole { 127.127.0.0; };'
echo '};'
}
echo 'options {'
echo ' port 5300;'
echo " listen-on { $1; };"
echo " query-source $1;"
echo " notify-source $1;"
echo " transfer-source $1;"
echo ' key-directory "keys";'
echo " recursion ${2:-no};"
echo ' pid-file "pids/'"${addr}"'.pid";'
echo ' allow-query { !127.127.0.0; any; };'
echo '};'
}
echo 'options {'
echo ' port 5300;'
echo " listen-on { $1; };"
echo " query-source $1;"
echo " notify-source $1;"
echo " transfer-source $1;"
echo ' key-directory "keys";'
echo " recursion ${2:-no};"
echo ' pid-file "pids/'"${addr}"'.pid";'
echo '};'
}
echo 'include "rndc.key";'
}
_s=$1
IFS="${IFS}/"
set ${2:-.}
case $1 in
.) _d=;;
*) _d=$1;;
esac
2) echo -T delay=${2:-50};;
3) echo -T delay=${3:-150};;
4) echo -T delay=${4:-250};;
5) echo -T delay=${5:-125};;
6) echo -T delay=${6:-25};;
7) echo -T delay=${7:-75};;
8) echo -T delay=${8:-125};;
9) echo -T delay=${9:-10};;
10) echo -T delay=${10:-40};;
11) echo -T delay=${11:-80};;
12) echo -T delay=${12:-90};;
*) echo -T delay=50;;
esac
}
awk '$3 == "DNSKEY" {
b = ""; for (i=7; i <= NF; i++) { b = b $i; };
print "trusted-keys { \""$1"\"",$4,$5,$6,"\""b"\"; };" };'
}
echo "zone "'"'"${1:-.}"'"'" {"
echo " type master;"
echo " file "'"'"master/${2}.db"'"'";"
echo " auto-dnssec maintain;"
echo " allow-update { any; };"
echo "};"
}
echo "zone "'"'"${1:-.}"'"'" {"
echo " type master;"
echo " file "'"'"master/${2}.db"'"'";"
echo "};"
}
echo "zone "'"'"${zone:-.}"'"'" {"
echo " type slave;"
echo " masters { ${master}; };"
echo "};"
}
echo 'zone "." { type hint; file "master/hint.db"; };' >> named.conf
do
i=1
case "${zone}" in
esac
if [ "${zone}" != "" ] ; then
case "${p}" in
"") p=root;;
esac
else
p=hint
fi
#echo "zone='${zone}' parent='${p}'"
echo "${zone}. ${ttl} soa ${ns}. hostmaster.${zone}${zone:+.} 1 3600 1200 604800 1200" >> master/${file}.db
if [ $signed = "S" ]; then
if [ "${zone}" != "" ] ; then
else
fi
fi
*) echo ${signed}; exit 1;;
esac
# slave servers
do
i=$(($i + 1))
if [ $i = ${refuse:-.} ]
then
elif [ $i = ${blackhole:-.} ]
then
else
fi
done
if [ "${zone}" != "" ] ; then
i=0
while [ $i -lt 150 ]
do
i=$(($i + 1))
done
i=0
while [ $i -lt 120 ]
do
i=$(($i + 1))
done
i=0
while [ $i -lt 120 ]
do
i=$(($i + 1))
done
fi
done