2000-07-14 23:38:14 +00:00
|
|
|
#!/bin/sh
|
2021-06-03 08:37:05 +02:00
|
|
|
|
2018-02-23 09:53:12 +01:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2012-06-29 11:39:47 +10:00
|
|
|
#
|
2021-06-03 08:37:05 +02:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
#
|
2016-06-27 14:56:38 +10:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
2021-06-03 08:37:05 +02:00
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
#
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
# information regarding copyright ownership.
|
2004-03-05 05:14:21 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
# shellcheck source=conf.sh
|
2020-07-21 12:12:59 +02:00
|
|
|
. ../conf.sh
|
2018-02-20 15:43:27 -08:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts() {
|
|
|
|
"${DIG}" -p "${PORT}" "${@}"
|
|
|
|
}
|
|
|
|
|
|
|
|
resolve_with_opts() {
|
|
|
|
"${RESOLVE}" -p "${PORT}" "${@}"
|
|
|
|
}
|
|
|
|
|
|
|
|
rndccmd() {
|
|
|
|
"${RNDC}" -c ../common/rndc.conf -p "${CONTROLPORT}" -s "${@}"
|
|
|
|
}
|
2000-07-14 23:38:14 +00:00
|
|
|
|
|
|
|
status=0
|
2010-09-15 12:07:56 +00:00
|
|
|
n=0
|
2000-07-14 23:38:14 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking non-cachable NXDOMAIN response handling ($n)"
|
2010-05-19 06:39:50 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp nxdomain.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NXDOMAIN" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-05-19 06:39:50 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking non-cachable NXDOMAIN response handling using dns_client ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 nxdomain.example.net 2> resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "resolution failed: ncache nxdomain" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2013-11-13 10:52:22 -08:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking that local bound address can be set (Can't query from a denied address) ($n)"
|
2013-11-13 10:52:22 -08:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -b 10.53.0.8 -t a -s 10.53.0.1 www.example.org 2> resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "resolution failed: SERVFAIL" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-11-13 10:52:22 -08:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking that local bound address can be set (Can query from an allowed address) ($n)"
|
2013-11-13 10:52:22 -08:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -b 10.53.0.1 -t a -s 10.53.0.1 www.example.org > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "www.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-11-13 10:52:22 -08:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking non-cachable NODATA response handling ($n)"
|
2010-05-19 06:39:50 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp nodata.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking non-cachable NODATA response handling using dns_client ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 nodata.example.net 2> resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "resolution failed: ncache nxrrset" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking handling of bogus referrals ($n)"
|
2000-07-18 17:13:40 +00:00
|
|
|
# If the server has the "INSIST(!external)" bug, this query will kill it.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.com. a @10.53.0.1 >/dev/null || { echo_i "failed"; status=$((status + 1)); }
|
2000-07-28 22:42:42 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking handling of bogus referrals using dns_client ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 www.example.com 2> resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "resolution failed: SERVFAIL" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check handling of cname + other data / 1 ($n)"
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp cname1.example.com. a @10.53.0.1 >/dev/null || { echo_i "failed"; status=$((status + 1)); }
|
2000-07-28 22:42:42 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check handling of cname + other data / 2 ($n)"
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp cname2.example.com. a @10.53.0.1 >/dev/null || { echo_i "failed"; status=$((status + 1)); }
|
2000-07-18 17:13:40 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that server is still running ($n)"
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.com. a @10.53.0.1 >/dev/null || { echo_i "failed"; status=$((status + 1)); }
|
2000-07-14 23:38:14 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv4 address filtering (deny) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: SERVFAIL" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv6 address filtering (deny) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.net @10.53.0.1 aaaa > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: SERVFAIL" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv4 address filtering (accept) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.org @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-03 17:27:40 +11:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv4 address filtering using dns_client (accept) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 www.example.org > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "www.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv6 address filtering (accept) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.example.org @10.53.0.1 aaaa > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking answer IPv6 address filtering using dns_client (accept) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t aaaa -s 10.53.0.1 www.example.org > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "www.example.org..*.2001:db8:beef::1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking CNAME target filtering (deny) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp badcname.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: SERVFAIL" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking CNAME target filtering (accept) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp goodcname.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking CNAME target filtering using dns_client (accept) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 goodcname.example.net > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "goodcname.example.net..*.goodcname.example.org." resolve.out.ns1.test${n} > /dev/null || ret=1
|
|
|
|
grep "goodcname.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking CNAME target filtering (accept due to subdomain) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp cname.sub.example.org @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking CNAME target filtering using dns_client (accept due to subdomain) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 cname.sub.example.org > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "cname.sub.example.org..*.ok.sub.example.org." resolve.out.ns1.test${n} > /dev/null || ret=1
|
|
|
|
grep "ok.sub.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking DNAME target filtering (deny) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp foo.baddname.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2018-07-24 10:18:58 -07:00
|
|
|
grep "DNAME target foo.baddname.example.org denied for foo.baddname.example.net/IN" ns1/named.run >/dev/null || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: SERVFAIL" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking DNAME target filtering (accept) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp foo.gooddname.example.net @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking DNAME target filtering using dns_client (accept) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 foo.gooddname.example.net > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "foo.gooddname.example.net..*.gooddname.example.org" resolve.out.ns1.test${n} > /dev/null || ret=1
|
|
|
|
grep "foo.gooddname.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking DNAME target filtering (accept due to subdomain) ($n)"
|
2009-05-29 22:22:37 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp www.dname.sub.example.org @10.53.0.1 a > dig.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "status: NOERROR" dig.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2009-05-29 22:22:37 +00:00
|
|
|
|
2013-04-10 13:49:57 -07:00
|
|
|
if [ -x ${RESOLVE} ] ; then
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking DNAME target filtering using dns_client (accept due to subdomain) ($n)"
|
2013-04-03 17:27:40 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
resolve_with_opts -t a -s 10.53.0.1 www.dname.sub.example.org > resolve.out.ns1.test${n} || ret=1
|
2016-12-13 15:02:32 +11:00
|
|
|
grep "www.dname.sub.example.org..*.ok.sub.example.org." resolve.out.ns1.test${n} > /dev/null || ret=1
|
|
|
|
grep "www.ok.sub.example.org..*.192.0.2.1" resolve.out.ns1.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-04-03 17:27:40 +11:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-08-22 10:12:53 +02:00
|
|
|
echo_i "check that the resolver accepts a referral response with a non-empty ANSWER section ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.1 foo.glue-in-answer.example.org. A > dig.ns1.out.${n} || ret=1
|
2018-08-22 10:12:53 +02:00
|
|
|
grep "status: NOERROR" dig.ns1.out.${n} > /dev/null || ret=1
|
|
|
|
grep "foo.glue-in-answer.example.org.*192.0.2.1" dig.ns1.out.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2020-03-05 18:46:46 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2020-03-05 18:46:46 +00:00
|
|
|
echo_i "check that the resolver limits the number of NS records it follows in a referral response ($n)"
|
2021-11-15 21:59:37 -08:00
|
|
|
# ns5 is the recusor being tested. ns4 holds the sourcens zone containing
|
|
|
|
# names with varying numbers of NS records pointing to non-existent
|
|
|
|
# nameservers in the targetns zone on ns6.
|
2020-03-05 18:46:46 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
rndccmd 10.53.0.5 flush || ret=1 # Ensure cache is empty before doing this test
|
2021-11-15 21:59:37 -08:00
|
|
|
count_fetches () {
|
2022-01-14 11:00:24 +01:00
|
|
|
actual=$(nextpartpeek ns5/named.run | grep -c " fetch: ns.fake${nscount}")
|
|
|
|
[ "${actual:-0}" -eq "${expected}" ] || return 1
|
2021-11-15 21:59:37 -08:00
|
|
|
return 0
|
|
|
|
}
|
2020-03-05 18:46:46 +00:00
|
|
|
for nscount in 1 2 3 4 5 6 7 8 9 10
|
|
|
|
do
|
|
|
|
# Verify number of NS records at source server
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +norecurse @10.53.0.4 target${nscount}.sourcens ns > dig.ns4.out.${nscount}.${n}
|
|
|
|
sourcerecs=$(grep NS dig.ns4.out.${nscount}.${n} | grep -cv ';')
|
|
|
|
test "${sourcerecs}" -eq "${nscount}" || ret=1
|
|
|
|
test "${sourcerecs}" -eq "${nscount}" || echo_i "NS count incorrect for target${nscount}.sourcens"
|
2021-11-15 21:59:37 -08:00
|
|
|
|
2020-03-05 18:46:46 +00:00
|
|
|
# Expected queries = 2 * number of NS records, up to a maximum of 10.
|
2022-01-14 11:00:24 +01:00
|
|
|
expected=$((nscount*2))
|
|
|
|
if [ "$expected" -gt 10 ]; then expected=10; fi
|
2021-11-15 21:59:37 -08:00
|
|
|
# Count the number of logged fetches
|
|
|
|
nextpart ns5/named.run > /dev/null
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 target${nscount}.sourcens A > dig.ns5.out.${nscount}.${n} || ret=1
|
2021-11-15 21:59:37 -08:00
|
|
|
retry_quiet 5 count_fetches ns5/named.run $nscount $expected || {
|
|
|
|
echo_i "query count error: $nscount NS records: expected queries $expected, actual $actual"; ret=1;
|
|
|
|
}
|
2020-03-05 18:46:46 +00:00
|
|
|
done
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2018-08-22 10:12:53 +02:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "RT21594 regression test check setup ($n)"
|
2010-09-15 12:07:56 +00:00
|
|
|
ret=0
|
|
|
|
# Check that "aa" is not being set by the authoritative server.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp . @10.53.0.4 soa > dig.ns4.out.${n} || ret=1
|
2010-09-15 23:22:02 +00:00
|
|
|
grep 'flags: qr rd;' dig.ns4.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-09-15 12:07:56 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "RT21594 regression test positive answers ($n)"
|
2010-09-15 12:07:56 +00:00
|
|
|
ret=0
|
|
|
|
# Check that resolver accepts the non-authoritative positive answers.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp . @10.53.0.5 soa > dig.ns5.out.${n} || ret=1
|
2010-09-15 12:07:56 +00:00
|
|
|
grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-09-15 12:07:56 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "RT21594 regression test NODATA answers ($n)"
|
2010-09-15 12:07:56 +00:00
|
|
|
ret=0
|
|
|
|
# Check that resolver accepts the non-authoritative nodata answers.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp . @10.53.0.5 txt > dig.ns5.out.${n} || ret=1
|
2010-09-15 12:07:56 +00:00
|
|
|
grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-09-15 12:07:56 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "RT21594 regression test NXDOMAIN answers ($n)"
|
2010-09-15 12:07:56 +00:00
|
|
|
ret=0
|
|
|
|
# Check that resolver accepts the non-authoritative positive answers.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp noexistent @10.53.0.5 txt > dig.ns5.out.${n} || ret=1
|
2010-09-15 12:07:56 +00:00
|
|
|
grep "status: NXDOMAIN" dig.ns5.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-05-19 06:39:50 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that replacement of additional data by a negative cache no data entry clears the additional RRSIGs ($n)"
|
2010-11-16 06:46:44 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp mx example.net @10.53.0.7 > dig.ns7.out.${n} || ret=1
|
2010-11-16 06:46:44 +00:00
|
|
|
grep "status: NOERROR" dig.ns7.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret = 1 ]; then echo_i "mx priming failed"; fi
|
2010-11-16 06:46:44 +00:00
|
|
|
$NSUPDATE << EOF
|
2018-02-20 15:43:27 -08:00
|
|
|
server 10.53.0.6 ${PORT}
|
2010-11-16 06:46:44 +00:00
|
|
|
zone example.net
|
|
|
|
update delete mail.example.net A
|
|
|
|
update add mail.example.net 0 AAAA ::1
|
|
|
|
send
|
|
|
|
EOF
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp a mail.example.net @10.53.0.7 > dig.ns7.out.${n} || ret=2
|
2010-11-16 06:46:44 +00:00
|
|
|
grep "status: NOERROR" dig.ns7.out.${n} > /dev/null || ret=2
|
|
|
|
grep "ANSWER: 0" dig.ns7.out.${n} > /dev/null || ret=2
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret = 2 ]; then echo_i "ncache priming failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp mx example.net @10.53.0.7 > dig.ns7.out.${n} || ret=3
|
2010-11-16 06:46:44 +00:00
|
|
|
grep "status: NOERROR" dig.ns7.out.${n} > /dev/null || ret=3
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp rrsig mail.example.net +norec @10.53.0.7 > dig.ns7.out.${n} || ret=4
|
2010-11-16 06:46:44 +00:00
|
|
|
grep "status: NOERROR" dig.ns7.out.${n} > /dev/null || ret=4
|
|
|
|
grep "ANSWER: 0" dig.ns7.out.${n} > /dev/null || ret=4
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2010-11-16 06:46:44 +00:00
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2011-03-13 02:49:28 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking that update a nameservers address has immediate effects ($n)"
|
2011-03-13 02:49:28 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp TXT foo.moves @10.53.0.7 > dig.ns7.foo.${n} || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
grep "From NS 5" dig.ns7.foo.${n} > /dev/null || ret=1
|
2011-03-13 02:49:28 +00:00
|
|
|
$NSUPDATE << EOF
|
2018-02-20 15:43:27 -08:00
|
|
|
server 10.53.0.7 ${PORT}
|
2011-03-13 02:49:28 +00:00
|
|
|
zone server
|
|
|
|
update delete ns.server A
|
|
|
|
update add ns.server 300 A 10.53.0.4
|
|
|
|
send
|
|
|
|
EOF
|
|
|
|
sleep 1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp TXT bar.moves @10.53.0.7 > dig.ns7.bar.${n} || ret=1
|
2011-03-13 02:49:28 +00:00
|
|
|
grep "From NS 4" dig.ns7.bar.${n} > /dev/null || ret=1
|
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; status=1; fi
|
2011-03-13 02:49:28 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking that update a nameservers glue has immediate effects ($n)"
|
2011-03-13 02:49:28 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp TXT foo.child.server @10.53.0.7 > dig.ns7.foo.${n} || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
grep "From NS 5" dig.ns7.foo.${n} > /dev/null || ret=1
|
2011-03-13 02:49:28 +00:00
|
|
|
$NSUPDATE << EOF
|
2018-02-20 15:43:27 -08:00
|
|
|
server 10.53.0.7 ${PORT}
|
2011-03-13 02:49:28 +00:00
|
|
|
zone server
|
|
|
|
update delete ns.child.server A
|
|
|
|
update add ns.child.server 300 A 10.53.0.4
|
|
|
|
send
|
|
|
|
EOF
|
|
|
|
sleep 1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp TXT bar.child.server @10.53.0.7 > dig.ns7.bar.${n} || ret=1
|
2011-03-13 02:49:28 +00:00
|
|
|
grep "From NS 4" dig.ns7.bar.${n} > /dev/null || ret=1
|
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; status=1; fi
|
2011-03-13 02:49:28 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking empty RFC 1918 reverse zones ($n)"
|
2011-07-28 03:18:17 +00:00
|
|
|
ret=0
|
|
|
|
# Check that "aa" is being set by the resolver for RFC 1918 zones
|
|
|
|
# except the one that has been deliberately disabled
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 10.1.1.1 > dig.ns4.out.1.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.1.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 192.168.1.1 > dig.ns4.out.2.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.2.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.16.1.1 > dig.ns4.out.3.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.3.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.17.1.1 > dig.ns4.out.4.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.4.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.18.1.1 > dig.ns4.out.5.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.5.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.19.1.1 > dig.ns4.out.6.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.6.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.21.1.1 > dig.ns4.out.7.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.7.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.22.1.1 > dig.ns4.out.8.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.8.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.23.1.1 > dig.ns4.out.9.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.9.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.24.1.1 > dig.ns4.out.11.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.11.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.25.1.1 > dig.ns4.out.12.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.12.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.26.1.1 > dig.ns4.out.13.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.13.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.27.1.1 > dig.ns4.out.14.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.14.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.28.1.1 > dig.ns4.out.15.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.15.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.29.1.1 > dig.ns4.out.16.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.16.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.30.1.1 > dig.ns4.out.17.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.17.${n} > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.31.1.1 > dig.ns4.out.18.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr aa rd ra;' dig.ns4.out.18.${n} > /dev/null || ret=1
|
|
|
|
# but this one should NOT be authoritative
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 -x 172.20.1.1 > dig.ns4.out.19.${n} || ret=1
|
2011-07-28 03:18:17 +00:00
|
|
|
grep 'flags: qr rd ra;' dig.ns4.out.19.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; status=1; fi
|
2011-07-28 03:18:17 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "checking that removal of a delegation is honoured ($n)"
|
2012-02-09 20:54:46 +00:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 www.to-be-removed.tld A > dig.ns5.prime.${n}
|
2018-02-20 15:43:27 -08:00
|
|
|
grep "status: NOERROR" dig.ns5.prime.${n} > /dev/null || { ret=1; echo_i "priming failed"; }
|
2012-02-09 20:54:46 +00:00
|
|
|
cp ns4/tld2.db ns4/tld.db
|
2018-12-11 12:59:11 +01:00
|
|
|
rndc_reload ns4 10.53.0.4 tld
|
2012-02-09 20:54:46 +00:00
|
|
|
old=
|
|
|
|
for i in 0 1 2 3 4 5 6 7 8 9
|
|
|
|
do
|
|
|
|
foo=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 ns$i.to-be-removed.tld A > /dev/null
|
|
|
|
dig_with_opts @10.53.0.5 www.to-be-removed.tld A > dig.ns5.out.${n}
|
2012-02-09 20:54:46 +00:00
|
|
|
grep "status: NXDOMAIN" dig.ns5.out.${n} > /dev/null || foo=1
|
|
|
|
[ $foo = 0 ] && break
|
|
|
|
$NSUPDATE << EOF
|
2018-02-20 15:43:27 -08:00
|
|
|
server 10.53.0.6 ${PORT}
|
2012-02-09 20:54:46 +00:00
|
|
|
zone to-be-removed.tld
|
|
|
|
update add to-be-removed.tld 100 NS ns${i}.to-be-removed.tld
|
|
|
|
update delete to-be-removed.tld NS ns${old}.to-be-removed.tld
|
|
|
|
send
|
|
|
|
EOF
|
|
|
|
old=$i
|
|
|
|
sleep 1
|
|
|
|
done
|
2018-02-20 15:43:27 -08:00
|
|
|
[ $ret = 0 ] && ret=$foo;
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; status=1; fi
|
2012-02-09 20:54:46 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check for improved error message with SOA mismatch ($n)"
|
2012-11-21 16:44:34 -06:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.1 www.sub.broken aaaa > dig.out.ns1.test${n} || ret=1
|
2012-11-21 16:44:34 -06:00
|
|
|
grep "not subdomain of zone" ns1/named.run > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2012-11-21 16:44:34 -06:00
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
copy_setports ns7/named2.conf.in ns7/named.conf
|
2022-01-14 11:00:24 +01:00
|
|
|
rndccmd 10.53.0.7 reconfig 2>&1 | sed 's/^/ns7 /' | cat_i
|
2011-03-13 02:49:28 +00:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check resolution on the listening port ($n)"
|
2013-12-12 22:38:11 -08:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp +tries=2 +time=5 mx example.net @10.53.0.7 > dig.ns7.out.${n} || ret=2
|
2013-12-12 22:38:11 -08:00
|
|
|
grep "status: NOERROR" dig.ns7.out.${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1" dig.ns7.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; ret=1; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-01-12 21:29:15 +11:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check prefetch (${n})"
|
2014-01-12 21:29:15 +11:00
|
|
|
ret=0
|
2019-12-02 19:19:56 -03:00
|
|
|
# read prefetch value from config.
|
2022-01-14 11:00:24 +01:00
|
|
|
PREFETCH=$(sed -n "s/[[:space:]]*prefetch \([0-9]\).*/\1/p" ns5/named.conf)
|
|
|
|
dig_with_opts @10.53.0.5 fetch.tld txt > dig.out.1.${n} || ret=1
|
|
|
|
ttl1=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.1.${n})
|
2019-12-02 19:19:56 -03:00
|
|
|
interval=$((ttl1 - PREFETCH + 1))
|
2014-01-12 21:29:15 +11:00
|
|
|
# sleep so we are in prefetch range
|
2019-12-02 19:19:56 -03:00
|
|
|
sleep ${interval:-0}
|
2014-01-12 21:29:15 +11:00
|
|
|
# trigger prefetch
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 fetch.tld txt > dig.out.2.${n} || ret=1
|
|
|
|
ttl2=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n})
|
2014-01-12 21:29:15 +11:00
|
|
|
sleep 1
|
2020-02-20 14:49:36 -08:00
|
|
|
# check that prefetch occurred
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 fetch.tld txt > dig.out.3.${n} || ret=1
|
|
|
|
ttl=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.3.${n})
|
|
|
|
test "${ttl:-0}" -gt "${ttl2:-1}" || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-01-12 21:29:15 +11:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check prefetch of validated DS's RRSIG TTL is updated (${n})"
|
2016-08-25 09:51:31 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +dnssec @10.53.0.5 ds.example.net ds > dig.out.1.${n} || ret=1
|
|
|
|
dsttl1=$(awk '$4 == "DS" && $7 == "2" { print $2 }' dig.out.1.${n})
|
2019-12-02 19:19:56 -03:00
|
|
|
interval=$((dsttl1 - PREFETCH + 1))
|
2019-12-03 10:45:39 -03:00
|
|
|
# sleep so we are in prefetch range
|
2019-12-02 19:19:56 -03:00
|
|
|
sleep ${interval:-0}
|
2016-08-25 09:51:31 +10:00
|
|
|
# trigger prefetch
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 ds.example.net ds > dig.out.2.${n} || ret=1
|
|
|
|
dsttl2=$(awk '$4 == "DS" && $7 == "2" { print $2 }' dig.out.2.${n})
|
2016-08-25 09:51:31 +10:00
|
|
|
sleep 1
|
2020-02-20 14:49:36 -08:00
|
|
|
# check that prefetch occurred
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 ds.example.net ds +dnssec > dig.out.3.${n} || ret=1
|
|
|
|
dsttl=$(awk '$4 == "DS" && $7 == "2" { print $2 }' dig.out.3.${n})
|
|
|
|
sigttl=$(awk '$4 == "RRSIG" && $5 == "DS" { print $2 }' dig.out.3.${n})
|
|
|
|
test "${dsttl:-0}" -gt "${dsttl2:-1}" || ret=1
|
|
|
|
test "${sigttl:-0}" -gt "${dsttl2:-1}" || ret=1
|
|
|
|
test "${dsttl:-0}" -eq "${sigttl:-1}" || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2016-08-25 09:51:31 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check prefetch disabled (${n})"
|
2014-01-12 21:29:15 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 fetch.example.net txt > dig.out.1.${n} || ret=1
|
|
|
|
ttl1=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.1.${n})
|
2019-12-03 10:45:39 -03:00
|
|
|
interval=$((ttl1 - PREFETCH + 1))
|
2014-01-12 21:29:15 +11:00
|
|
|
# sleep so we are in expire range
|
2019-12-03 10:45:39 -03:00
|
|
|
sleep ${interval:-0}
|
2019-11-29 11:53:09 -03:00
|
|
|
tmp_ttl=$ttl1
|
2019-12-03 10:45:39 -03:00
|
|
|
no_prefetch() {
|
|
|
|
# fetch record and ensure its ttl is in range 0 < ttl < tmp_ttl.
|
|
|
|
# since prefetch is disabled, updated ttl must be a lower value than
|
|
|
|
# the previous one.
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 fetch.example.net txt > dig.out.2.${n} || return 1
|
|
|
|
ttl2=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n})
|
2020-02-20 14:49:36 -08:00
|
|
|
# check that prefetch has not occurred
|
2022-01-14 11:00:24 +01:00
|
|
|
if [ "$ttl2" -ge "${tmp_ttl}" ]; then
|
2019-12-03 10:45:39 -03:00
|
|
|
return 1
|
2019-11-29 11:53:09 -03:00
|
|
|
fi
|
|
|
|
tmp_ttl=$ttl2
|
2019-12-03 10:45:39 -03:00
|
|
|
}
|
|
|
|
retry_quiet 3 no_prefetch || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2013-12-12 22:38:11 -08:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check prefetch qtype * (${n})"
|
2014-05-05 10:12:12 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 fetchall.tld any > dig.out.1.${n} || ret=1
|
|
|
|
ttl1=$(awk '/"A" "short" "ttl"/ { print $2 - 3 }' dig.out.1.${n})
|
2014-05-05 10:12:12 +10:00
|
|
|
# sleep so we are in prefetch range
|
2022-01-14 11:00:24 +01:00
|
|
|
sleep "${ttl1:-0}"
|
2014-05-05 10:12:12 +10:00
|
|
|
# trigger prefetch
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 fetchall.tld any > dig.out.2.${n} || ret=1
|
|
|
|
ttl2=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n})
|
2014-05-05 10:12:12 +10:00
|
|
|
sleep 1
|
|
|
|
# check that the nameserver is still alive
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 fetchall.tld any > dig.out.3.${n} || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-05-05 10:12:12 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that E was logged on EDNS queries in the query log (${n})"
|
2014-05-29 08:04:55 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 +edns edns.fetchall.tld any > dig.out.2.${n} || ret=1
|
2014-05-29 10:45:52 +10:00
|
|
|
grep "query: edns.fetchall.tld IN ANY +E" ns5/named.run > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 +noedns noedns.fetchall.tld any > dig.out.2.${n} || ret=1
|
2014-05-29 08:04:55 +10:00
|
|
|
grep "query: noedns.fetchall.tld IN ANY" ns5/named.run > /dev/null || ret=1
|
|
|
|
grep "query: noedns.fetchall.tld IN ANY +E" ns5/named.run > /dev/null && ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-05-29 08:04:55 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that '-t aaaa' in .digrc does not have unexpected side effects ($n)"
|
2014-07-08 02:00:28 +10:00
|
|
|
ret=0
|
|
|
|
echo "-t aaaa" > .digrc
|
2022-01-14 11:00:24 +01:00
|
|
|
HOME="$(pwd)" dig_with_opts @10.53.0.4 . > dig.out.1.${n} || ret=1
|
|
|
|
HOME="$(pwd)" dig_with_opts @10.53.0.4 . A > dig.out.2.${n} || ret=1
|
|
|
|
HOME="$(pwd)" dig_with_opts @10.53.0.4 -x 127.0.0.1 > dig.out.3.${n} || ret=1
|
2014-07-08 02:00:28 +10:00
|
|
|
grep ';\..*IN.*AAAA$' dig.out.1.${n} > /dev/null || ret=1
|
|
|
|
grep ';\..*IN.*A$' dig.out.2.${n} > /dev/null || ret=1
|
|
|
|
grep 'extra type option' dig.out.2.${n} > /dev/null && ret=1
|
|
|
|
grep ';1\.0\.0\.127\.in-addr\.arpa\..*IN.*PTR$' dig.out.3.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-07-08 02:00:28 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
edns=$($FEATURETEST --edns-version)
|
2014-09-10 15:31:40 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that EDNS version is logged (${n})"
|
2014-09-10 15:31:40 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 +edns edns0.fetchall.tld any > dig.out.2.${n} || ret=1
|
2014-09-10 15:31:40 +10:00
|
|
|
grep "query: edns0.fetchall.tld IN ANY +E(0)" ns5/named.run > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
if test "${edns:-0}" != 0; then
|
|
|
|
dig_with_opts @10.53.0.5 +edns=1 edns1.fetchall.tld any > dig.out.2.${n} || ret=1
|
2014-09-10 15:31:40 +10:00
|
|
|
grep "query: edns1.fetchall.tld IN ANY +E(1)" ns5/named.run > /dev/null || ret=1
|
|
|
|
fi
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-09-10 15:31:40 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
if test "${edns:-0}" != 0; then
|
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that edns-version is honoured (${n})"
|
2014-09-10 15:31:40 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 +edns no-edns-version.tld > dig.out.1.${n} || ret=1
|
2014-09-10 15:31:40 +10:00
|
|
|
grep "query: no-edns-version.tld IN A -E(1)" ns6/named.run > /dev/null || ret=1
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 +edns edns-version.tld > dig.out.2.${n} || ret=1
|
2014-09-10 15:31:40 +10:00
|
|
|
grep "query: edns-version.tld IN A -E(0)" ns7/named.run > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-09-10 15:31:40 +10:00
|
|
|
fi
|
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that CNAME nameserver is logged correctly (${n})"
|
2014-12-03 11:34:07 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts soa all-cnames @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2014-12-03 11:34:07 +11:00
|
|
|
grep "status: SERVFAIL" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "skipping nameserver 'cname.tld' because it is a CNAME, while resolving 'all-cnames/SOA'" ns5/named.run > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2014-12-03 11:34:07 +11:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that unexpected opcodes are handled correctly (${n})"
|
2015-05-19 12:46:06 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts soa all-cnames @10.53.0.5 +opcode=15 +cd +rec +ad +zflag > dig.out.ns5.test${n} || ret=1
|
2015-05-19 12:46:06 +10:00
|
|
|
grep "status: NOTIMP" dig.out.ns5.test${n} > /dev/null || ret=1
|
2016-12-13 16:27:18 +11:00
|
|
|
grep "flags:[^;]* qr[; ]" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "flags:[^;]* ra[; ]" dig.out.ns5.test${n} > /dev/null && ret=1
|
|
|
|
grep "flags:[^;]* rd[; ]" dig.out.ns5.test${n} > /dev/null && ret=1
|
|
|
|
grep "flags:[^;]* cd[; ]" dig.out.ns5.test${n} > /dev/null && ret=1
|
|
|
|
grep "flags:[^;]* ad[; ]" dig.out.ns5.test${n} > /dev/null && ret=1
|
|
|
|
grep "flags:[^;]*; MBZ: " dig.out.ns5.test${n} > /dev/null && ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-05-19 12:46:06 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that EDNS client subnet with non-zeroed bits is handled correctly (${n})"
|
2015-07-06 12:52:37 +10:00
|
|
|
ret=0
|
|
|
|
# 0001 (IPv4) 1f (31 significant bits) 00 (0) ffffffff (255.255.255.255)
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts soa . @10.53.0.5 +ednsopt=8:00011f00ffffffff > dig.out.ns5.test${n} || ret=1
|
2015-07-06 12:52:37 +10:00
|
|
|
grep "status: FORMERR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "; EDNS: version:" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-07-06 12:52:37 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that dig +subnet zeros address bits correctly (${n})"
|
2015-07-06 12:52:37 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts soa . @10.53.0.5 +subnet=255.255.255.255/23 > dig.out.ns5.test${n} || ret=1
|
2015-07-06 12:52:37 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "CLIENT-SUBNET: 255.255.254.0/23/0" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-07-06 12:52:37 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that SOA query returns data for delegation-only apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts soa delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
|
|
|
n=$((n+1))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that NS query returns data for delegation-only apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts ns delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that A query returns data for delegation-only A apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts a delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that CDS query returns data for delegation-only apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts cds delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that AAAA query returns data for delegation-only AAAA apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts a delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
|
|
|
n=$((n+1))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that DNSKEY query returns data for delegation-only apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts dnskey delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that CDNSKEY query returns data for delegation-only apex (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts cdnskey delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns5.test${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that NXDOMAIN is returned for delegation-only non-apex A data (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts a a.delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NXDOMAIN" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that NXDOMAIN is returned for delegation-only non-apex CDS data (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts cds cds.delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NXDOMAIN" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that NXDOMAIN is returned for delegation-only non-apex AAAA data (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts aaaa aaaa.delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NXDOMAIN" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
|
|
|
n=$((n+1))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that NXDOMAIN is returned for delegation-only non-apex CDNSKEY data (${n})"
|
2015-09-30 15:55:14 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts cdnskey cdnskey.delegation-only @10.53.0.5 > dig.out.ns5.test${n} || ret=1
|
2015-09-30 15:55:14 +10:00
|
|
|
grep "status: NXDOMAIN" dig.out.ns5.test${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2015-09-30 15:55:14 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check zero ttl not returned for learnt non zero ttl records (${n})"
|
2016-03-21 13:22:21 +11:00
|
|
|
ret=0
|
|
|
|
# use prefetch disabled server
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 non-zero.example.net txt > dig.out.1.${n} || ret=1
|
|
|
|
ttl1=$(awk '/"A" "short" "ttl"/ { print $2 - 2 }' dig.out.1.${n})
|
2016-03-21 13:22:21 +11:00
|
|
|
# sleep so we are in expire range
|
2022-01-14 11:00:24 +01:00
|
|
|
sleep "${ttl1:-0}"
|
2016-03-21 13:22:21 +11:00
|
|
|
# look for ttl = 1, allow for one miss at getting zero ttl
|
|
|
|
zerotonine="0 1 2 3 4 5 6 7 8 9"
|
|
|
|
zerotonine="$zerotonine $zerotonine $zerotonine"
|
|
|
|
for i in $zerotonine $zerotonine $zerotonine $zerotonine
|
|
|
|
do
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 non-zero.example.net txt > dig.out.2.${n} || ret=1
|
|
|
|
ttl2=$(awk '/"A" "short" "ttl"/ { print $2 }' dig.out.2.${n})
|
|
|
|
test "${ttl2:-1}" -eq 0 && break
|
|
|
|
test "${ttl2:-1}" -ge "${ttl1:-0}" && break
|
|
|
|
"${PERL}" -e 'select(undef, undef, undef, 0.05);'
|
2016-03-21 13:22:21 +11:00
|
|
|
done
|
2022-01-14 11:00:24 +01:00
|
|
|
test "${ttl2:-1}" -eq 0 && ret=1
|
|
|
|
test "${ttl2:-1}" -ge "${ttl1:-0}" || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2016-03-21 13:22:21 +11:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check zero ttl is returned for learnt zero ttl records (${n})"
|
2016-03-21 13:22:21 +11:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 zero.example.net txt > dig.out.1.${n} || ret=1
|
|
|
|
ttl=$(awk '/"A" "zero" "ttl"/ { print $2 }' dig.out.1.${n})
|
|
|
|
test "${ttl:-1}" -eq 0 || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2016-06-14 13:48:39 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that 'ad' in not returned in truncated answer with empty answer and authority sections to request with +ad (${n})"
|
2017-05-03 07:51:41 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.6 dnskey ds.example.net +bufsize=512 +ad +nodnssec +ignore +norec > dig.out.$n
|
2017-05-03 07:51:41 +10:00
|
|
|
grep "flags: qr aa tc; QUERY: 1, ANSWER: 0, AUTHORITY: 0" dig.out.$n > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2017-05-03 07:51:41 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that 'ad' in not returned in truncated answer with empty answer and authority sections to request with +dnssec (${n})"
|
2017-05-03 07:51:41 +10:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.6 dnskey ds.example.net +bufsize=512 +noad +dnssec +ignore +norec > dig.out.$n
|
2017-05-03 07:51:41 +10:00
|
|
|
grep "flags: qr aa tc; QUERY: 1, ANSWER: 0, AUTHORITY: 0" dig.out.$n > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2017-05-03 07:51:41 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that the resolver accepts a reply with empty question section with TC=1 and retries over TCP ($n)"
|
2017-09-12 15:26:30 -07:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 truncated.no-questions. a +tries=3 +time=4 > dig.ns5.out.${n} || ret=1
|
2017-09-12 15:26:30 -07:00
|
|
|
grep "status: NOERROR" dig.ns5.out.${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.ns5.out.${n} > /dev/null || ret=1
|
2019-02-26 12:33:19 +01:00
|
|
|
grep "1\.2\.3\.4" dig.ns5.out.${n} > /dev/null || ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2017-09-12 15:26:30 -07:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "check that the resolver rejects a reply with empty question section with TC=0 ($n)"
|
2017-09-12 15:26:30 -07:00
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 not-truncated.no-questions. a +tries=3 +time=4 > dig.ns5.out.${n} || ret=1
|
2017-09-12 15:26:30 -07:00
|
|
|
grep "status: NOERROR" dig.ns5.out.${n} > /dev/null && ret=1
|
|
|
|
grep "ANSWER: 1," dig.ns5.out.${n} > /dev/null && ret=1
|
2019-02-26 12:33:19 +01:00
|
|
|
grep "1\.2\.3\.4" dig.ns5.out.${n} > /dev/null && ret=1
|
2018-02-20 15:43:27 -08:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2017-09-12 15:26:30 -07:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2021-12-03 11:29:56 -08:00
|
|
|
echo_i "check that SERVFAIL is returned for an empty question section via TCP ($n)"
|
|
|
|
ret=0
|
|
|
|
nextpart ns5/named.run > /dev/null
|
|
|
|
# bind to local address so that addresses in log messages are consistent
|
|
|
|
# between platforms; use tcp to get SERVFAIL rather than timeout on slow
|
|
|
|
# machines
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 -b 10.53.0.5 +tcp tcpalso.no-questions. a +tries=3 +time=4 > dig.ns5.out.${n} || ret=1
|
2021-12-03 11:29:56 -08:00
|
|
|
grep "status: SERVFAIL" dig.ns5.out.${n} > /dev/null || ret=1
|
|
|
|
check_namedrun() {
|
|
|
|
nextpartpeek ns5/named.run > nextpart.out.${n}
|
|
|
|
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section, accepting it anyway as TC=1' nextpart.out.${n} > /dev/null || return 1
|
|
|
|
grep '(tcpalso.no-questions/A): connecting via TCP' nextpart.out.${n} > /dev/null || return 1
|
|
|
|
grep 'resolving tcpalso.no-questions/A for [^:]*: empty question section$' nextpart.out.${n} > /dev/null || return 1
|
|
|
|
grep '(tcpalso.no-questions/A): nextitem' nextpart.out.${n} > /dev/null || return 1
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
retry_quiet 12 check_namedrun || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2021-12-03 11:29:56 -08:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2018-10-23 13:45:30 +02:00
|
|
|
echo_i "checking SERVFAIL is returned when all authoritative servers return FORMERR ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.5 ns.formerr-to-all. a > dig.ns5.out.${n} || ret=1
|
2018-10-23 13:45:30 +02:00
|
|
|
grep "status: SERVFAIL" dig.ns5.out.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2018-10-23 13:45:30 +02:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2019-08-09 13:02:07 +10:00
|
|
|
echo_i "check logged command line ($n)"
|
|
|
|
ret=0
|
2021-05-11 12:59:35 +02:00
|
|
|
grep "running as: .* -m record " ns1/named.run > /dev/null || ret=1
|
2019-08-09 13:02:07 +10:00
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2019-08-09 13:02:07 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2020-01-15 15:22:06 -03:00
|
|
|
echo_i "checking NXDOMAIN is returned when querying non existing domain in CH class ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.1 id.hostname txt ch > dig.ns1.out.${n} || ret=1
|
2020-01-15 15:22:06 -03:00
|
|
|
grep "status: NXDOMAIN" dig.ns1.out.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2020-01-15 15:22:06 -03:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2019-07-05 16:20:20 +10:00
|
|
|
echo_i "check that the addition section for HTTPS is populated on initial query to a recursive server ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 www.example.net https > dig.out.ns7.${n} || ret=1
|
2019-07-05 16:20:20 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "flags:[^;]* ra[ ;]" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ADDITIONAL: 2" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "http-server\.example\.net\..*A.*10\.53\.0\.6" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2019-07-05 16:20:20 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2019-07-05 16:20:20 +10:00
|
|
|
echo_i "check HTTPS loop is handled properly ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 https-loop.example.net https > dig.out.ns7.${n} || ret=1
|
2019-07-05 16:20:20 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ADDITIONAL: 2" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2019-07-05 16:20:20 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2019-07-05 16:20:20 +10:00
|
|
|
echo_i "check HTTPS -> CNAME loop is handled properly ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 https-cname-loop.example.net https > dig.out.ns7.${n} || ret=1
|
2019-07-05 16:20:20 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ADDITIONAL: 2" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ANSWER: 1," dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2019-07-05 16:20:20 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2019-07-05 16:20:20 +10:00
|
|
|
echo_i "check HTTPS cname chains are followed ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts @10.53.0.7 https-cname.example.net https > dig.out.ns7.${n} || ret=1
|
2019-07-05 16:20:20 +10:00
|
|
|
grep "status: NOERROR" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep "ADDITIONAL: 4" dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep 'http-server\.example\.net\..*A.10\.53\.0\.6' dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep 'cname-server\.example\.net\..*CNAME.cname-next\.example\.net\.' dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
grep 'cname-next\.example\.net\..*CNAME.http-server\.example\.net\.' dig.out.ns7.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2019-07-05 16:20:20 +10:00
|
|
|
|
2022-01-14 11:00:24 +01:00
|
|
|
n=$((n+1))
|
2021-10-18 23:14:28 -07:00
|
|
|
echo_i "check ADB find loops are detected ($n)"
|
|
|
|
ret=0
|
2022-01-14 11:00:24 +01:00
|
|
|
dig_with_opts +tcp +tries=1 +timeout=5 @10.53.0.1 fake.lame.example.org > dig.out.ns1.${n} || ret=1
|
2021-10-18 23:14:28 -07:00
|
|
|
grep "status: SERVFAIL" dig.out.ns1.${n} > /dev/null || ret=1
|
|
|
|
if [ $ret != 0 ]; then echo_i "failed"; fi
|
2022-01-14 11:00:24 +01:00
|
|
|
status=$((status + ret))
|
2021-10-18 23:14:28 -07:00
|
|
|
|
2018-02-20 15:43:27 -08:00
|
|
|
echo_i "exit status: $status"
|
2016-06-14 13:48:39 +10:00
|
|
|
[ $status -eq 0 ] || exit 1
|