2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Check "records but is not served by" warnings

This checks that "zone has A records but is not served by IPv4
servers" and "zone has AAAA records but is not served by IPv6
servers" are emitted when they should be and not when they shouldn't
be.
This commit is contained in:
Mark Andrews 2023-10-17 15:28:22 +11:00
parent 6d44e7320e
commit 673e966d37
5 changed files with 126 additions and 0 deletions

View File

@ -218,5 +218,41 @@ echo $lines
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning ($n)"
ret=0
$CHECKZONE example zones/warn.no-a.server.db >test.out1.$n 2>&1 || ret=1
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning ($n)"
ret=0
$CHECKZONE example zones/warn.no-aaaa.server.db >test.out1.$n 2>&1 || ret=1
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "Checking for 'zone has A records but is not served by IPv4 servers' warning for glue ($n)"
ret=0
$CHECKZONE example zones/warn.no-a.server.glue.db >test.out1.$n 2>&1 || ret=1
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null || ret=1
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "Checking for 'zone has AAAA records but is not served by IPv6 servers' warning for glue ($n)"
ret=0
$CHECKZONE example zones/warn.no-aaaa.server.glue.db >test.out1.$n 2>&1 || ret=1
grep "zone has AAAA records but is not served by IPv6 servers" test.out1.$n >/dev/null || ret=1
grep "zone has A records but is not served by IPv4 servers" test.out1.$n >/dev/null && ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1

View File

@ -0,0 +1,22 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; SPDX-License-Identifier: MPL-2.0
;
; 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 https://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30
@ 7200 IN NS ns1
@ 7200 IN NS ns2
@ 7200 IN NS ns3
@ 7200 IN NS ns4
ns1 3600 IN AAAA fd92:7065:b8e:ffff::1
ns2 3600 IN AAAA fd92:7065:b8e:ffff::2
ns3 3600 IN AAAA fd92:7065:b8e:ffff::4
ns4 3600 IN AAAA fd92:7065:b8e:ffff::4
dualstack 300 IN AAAA 2001:db8::1
dualstack 300 IN A 10.53.0.5

View File

@ -0,0 +1,23 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; SPDX-License-Identifier: MPL-2.0
;
; 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 https://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30
@ 7200 IN NS ns1
@ 7200 IN NS ns2
@ 7200 IN NS ns3
@ 7200 IN NS ns4
ns1 3600 IN AAAA fd92:7065:b8e:ffff::1
ns2 3600 IN AAAA fd92:7065:b8e:ffff::2
ns3 3600 IN AAAA fd92:7065:b8e:ffff::4
ns4 3600 IN AAAA fd92:7065:b8e:ffff::4
child 3600 IN NS ns1.child
ns1.child 300 IN AAAA 2001:db8::1
ns1.child 300 IN A 10.53.0.5

View File

@ -0,0 +1,22 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; SPDX-License-Identifier: MPL-2.0
;
; 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 https://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30
@ 7200 IN NS ns1
@ 7200 IN NS ns2
@ 7200 IN NS ns3
@ 7200 IN NS ns4
ns1 3600 IN A 10.53.0.1
ns2 3600 IN A 10.53.0.2
ns3 3600 IN A 10.53.0.4
ns4 3600 IN A 10.53.0.4
dualstack 300 IN AAAA 2001:db8::1
dualstack 300 IN A 10.53.0.5

View File

@ -0,0 +1,23 @@
; Copyright (C) Internet Systems Consortium, Inc. ("ISC")
;
; SPDX-License-Identifier: MPL-2.0
;
; 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 https://mozilla.org/MPL/2.0/.
;
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
@ 30 IN SOA ns1 hostmaster 2017052201 3600 600 604800 30
@ 7200 IN NS ns1
@ 7200 IN NS ns2
@ 7200 IN NS ns3
@ 7200 IN NS ns4
ns1 3600 IN A 10.53.0.1
ns2 3600 IN A 10.53.0.2
ns3 3600 IN A 10.53.0.4
ns4 3600 IN A 10.53.0.4
child 3600 IN NS ns1.child
ns1.child 300 IN AAAA 2001:db8::1
ns1.child 300 IN A 10.53.0.5