server:
ip-address: 127.0.0.1@$port
database: ./nsd.db
+ difffile: ./ixfr.db
+ xfrdfile: ./ixfr.state
+
zonesdir: .
username: ""
skipreasons="bind optout nodyndns"
;;
esac
- named -c bind.conf -f &
+ named -c bind.conf -g &
sleep 5
;;
startslave ()
{
skipreasons="$skipreasons presigned nodyndns"
- if [ ${presignedcontext:0:6} = gmysql ] || [ ${presignedcontext:0:7} = ext-nsd ] || [ ${presignedcontext:0:8} = ext-bind ]
+ if [ ${presignedcontext:0:6} = gmysql ]
then
context=${context}-presigned
[ -z "$GMYSQL2DB" ] && GMYSQL2DB=pdnstest2
--cache-ttl=$cachettl --no-config --bind-dnssec-db=./dnssec-slave.sqlite3 &
echo 'waiting for zones to be loaded'
bindwait bind-slave
- elif [ ${presignedcontext:0:3} = nsd ]
+ elif [ ${presignedcontext:0:7} = ext-nsd ]
then
skipreasons="$skipreasons nsd"
- context=nsd-presigned
+ context=$context-presigned
cat > nsd-slave.conf << __EOF__
server:
ip-address: 127.0.0.1@$((port+100))
nsd -c nsd-slave.conf -P pdns-slave.pid -d &
sleep 20
+ elif [ ${presignedcontext:0:8} = ext-bind ]
+ then
+ skipreasons="$skipreasons bind"
+ context=$context-presigned
+ cat > bind-slave.conf << __EOF__
+options {
+ dnssec-enable yes;
+ listen-on port $(($port+100)) { 127.0.0.1; };
+ minimal-responses yes;
+ pid-file "pdns-slave.pid";
+};
+
+key test {
+ algorithm $ALGORITHM;
+ secret "$KEY";
+};
+__EOF__
+
+ rm -f ixfr-slave.db
+ rm -f ixfr-slave.state
+
+ for zone in $(grep zone named.conf | cut -f2 -d\")
+ do
+ rm -f $zone-slave
+
+ echo "" >> bind-slave.conf
+ echo "zone \"${zone}\" {" >> bind-slave.conf
+ echo " type slave;" >> bind-slave.conf
+ echo " file \"${zone}-slave\";" >> bind-slave.conf
+ if [ "${zone}" = "tsig.com" ]
+ then
+ echo " masters port $port { 127.0.0.1 key test; };" >> bind-slave.conf
+ echo " allow-transfer { key test; none; };" >> bind-slave.conf
+ else
+ echo " masters port $port { 127.0.0.1; };" >> bind-slave.conf
+ fi
+ echo "};" >> bind-slave.conf
+ done
+
+ port=$((port+100))
+
+ named -c bind-slave.conf -g &
+ sleep 20
fi
}