-#!/bin/bash -e
-set pipefail
+#!/bin/bash
rm -f trustedkeys
rm -f unbound-host.conf
+
for zone in $(grep zone named.conf | cut -f2 -d\")
do
- if [ "${zone: 0:16}" != "secure-delegated" ]
- then
- drill -p $port -o rd -D dnskey $zone @$nameserver | grep -v '^;' | grep -v AwEAAarTiHhPgvD28WCN8UBXcEcf8f >> trustedkeys
- fi
- echo "stub-zone:" >> unbound-host.conf
- echo " name: $zone" >> unbound-host.conf
- echo " stub-addr: $nameserver@$port" >> unbound-host.conf
- echo "" >> unbound-host.conf
+ if [ "${zone: 0:16}" != "secure-delegated" ]
+ then
+ drill -p $port -o rd -D dnskey $zone @$nameserver | grep DNSKEY | grep -v '^;' | grep -v AwEAAarTiHhPgvD28WCN8UBXcEcf8f >> trustedkeys
+ fi
+ echo "stub-zone:" >> unbound-host.conf
+ echo " name: $zone" >> unbound-host.conf
+ echo " stub-addr: $nameserver@$port" >> unbound-host.conf
+ echo "" >> unbound-host.conf
done
echo "server:" >> unbound-host.conf
then
../pdns/sdig $nameserver $port "$1" $2 $3 $4 $5 | LC_ALL=C sort
fi
+../pdns/nsec3dig $nameserver $port "$1" $2 > ${testsdir}/${testname}/nsec3dig.out 2>&1
if [ ! -e ${testsdir}/${testname}/skip-drill ]
then
- ../pdns/nsec3dig $nameserver $port "$1" $2 > ${testsdir}/${testname}/nsec3dig.out 2>&1
- drill -a -p $port -o rd -D -S -k trustedkeys "$1" $2 @$nameserver > ${testsdir}/${testname}/drillchase.out 2>&1
- echo RETVAL: $? >> ${testsdir}/${testname}/drillchase.out
- drill -a -p $port -o rd -D -k trustedkeys "$1" $2 @$nameserver > ${testsdir}/${testname}/drill.out 2>&1
- echo RETVAL: $? >> ${testsdir}/${testname}/drill.out
+ if [ ! -s trustedkeys ]
+ then
+ drill -a -p $port -o rd -D "$1" $2 @$nameserver > ${testsdir}/${testname}/drill.out 2>&1
+ echo RETVAL: $? >> ${testsdir}/${testname}/drill.out
+ else
+ drill -a -p $port -o rd -D -S -k trustedkeys "$1" $2 @$nameserver > ${testsdir}/${testname}/drillchase.out 2>&1
+ echo RETVAL: $? >> ${testsdir}/${testname}/drillchase.out
+ drill -a -p $port -o rd -D -k trustedkeys "$1" $2 @$nameserver > ${testsdir}/${testname}/drill.out 2>&1
+ echo RETVAL: $? >> ${testsdir}/${testname}/drill.out
+ fi
fi
if [ ! -e ${testsdir}/${testname}/skip-q ]
then