]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check recovery from forwarding to a non-recursive server
authorMark Andrews <marka@isc.org>
Wed, 11 Sep 2019 07:08:47 +0000 (17:08 +1000)
committerEvan Hunt <each@isc.org>
Wed, 2 Oct 2019 05:14:22 +0000 (22:14 -0700)
(cherry picked from commit 47d285a7d67c75cf10a1e9cd1cb064d3f75e3bc5)

bin/tests/system/forward/ns1/named.conf.in
bin/tests/system/forward/ns1/sld.tld.db [new file with mode: 0644]
bin/tests/system/forward/ns2/named.conf.in
bin/tests/system/forward/ns2/tld.db [new file with mode: 0644]
bin/tests/system/forward/ns8/named.conf.in [new file with mode: 0644]
bin/tests/system/forward/ns8/root.db [new file with mode: 0644]
bin/tests/system/forward/setup.sh
bin/tests/system/forward/tests.sh

index 462b7378c012d5c73ee68fa33140709b9c750ecd..282e76bb64cca2da61e7fd0af5eab6a3e13d5272 100644 (file)
@@ -51,6 +51,11 @@ zone "example5." {
        file "example.db";
 };
 
+zone "sld.tld" {
+       type master;
+       file "sld.tld.db";
+};
+
 /* A forward zone without forwarders. */
 zone "example6" {
        type forward;
diff --git a/bin/tests/system/forward/ns1/sld.tld.db b/bin/tests/system/forward/ns1/sld.tld.db
new file mode 100644 (file)
index 0000000..5fab37a
--- /dev/null
@@ -0,0 +1,11 @@
+$TTL 300       ; 5 minutes
+@                      IN SOA  ns root (
+                               2000082401 ; serial
+                               1800       ; refresh (30 minutes)
+                               1800       ; retry (30 minutes)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns
+ns                     A       10.53.0.1
+xxx                    TXT     "foo"
index 190bd69953d65a464537b664e800f009b250de92..14ae9644c895ef5982743cfcd3d0d39fbdab8c54 100644 (file)
@@ -60,3 +60,8 @@ zone "1.0.10.in-addr.arpa." {
        type master;
        file "example.db";
 };
+
+zone "tld" {
+       type master;
+       file "tld.db";
+};
diff --git a/bin/tests/system/forward/ns2/tld.db b/bin/tests/system/forward/ns2/tld.db
new file mode 100644 (file)
index 0000000..61b6569
--- /dev/null
@@ -0,0 +1,12 @@
+$TTL 300       ; 5 minutes
+@                      IN SOA  ns root (
+                               2000082401 ; serial
+                               1800       ; refresh (30 minutes)
+                               1800       ; retry (30 minutes)
+                               1814400    ; expire (3 weeks)
+                               3600       ; minimum (1 hour)
+                               )
+                       NS      ns
+ns                     A       10.53.0.2
+sld                    NS      ns.sld
+ns.sld                 A       10.53.0.1
diff --git a/bin/tests/system/forward/ns8/named.conf.in b/bin/tests/system/forward/ns8/named.conf.in
new file mode 100644 (file)
index 0000000..531ff59
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 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/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+
+options {
+       query-source address 10.53.0.8;
+       notify-source 10.53.0.8;
+       transfer-source 10.53.0.8;
+       port @PORT@;
+       pid-file "named.pid";
+       listen-on { 10.53.0.8; };
+       listen-on-v6 { none; };
+       forwarders { 10.53.0.2; };      // returns referrals
+       forward first;
+       dnssec-validation yes;
+};
+
+zone "." {
+       type hint;
+       file "root.db";
+};
diff --git a/bin/tests/system/forward/ns8/root.db b/bin/tests/system/forward/ns8/root.db
new file mode 100644 (file)
index 0000000..0785fc7
--- /dev/null
@@ -0,0 +1,11 @@
+; Copyright (C) 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/.
+;
+; See the COPYRIGHT file distributed with this work for additional
+; information regarding copyright ownership.
+
+.                      NS      a.root-servers.nil.
+a.root-servers.nil.    A       10.53.0.1
index d64579e590fbbe8db01b4e1d6295aad73c82e23f..285ecc9de94543d4f4491b9c36b2848e3b451b81 100644 (file)
@@ -19,3 +19,4 @@ copy_setports ns3/named.conf.in ns3/named.conf
 copy_setports ns4/named.conf.in ns4/named.conf
 copy_setports ns5/named.conf.in ns5/named.conf
 copy_setports ns7/named.conf.in ns7/named.conf
+copy_setports ns8/named.conf.in ns8/named.conf
index 5a63e06e86c8b502eb9db940377891d9156488d6..36fd8a00409bd0bf409b1aa379bb277a2aead991 100644 (file)
@@ -159,5 +159,12 @@ sent=`grep "10.53.0.7#.* (.): query '\./NS/IN' approved" ns1/named.run | wc -l`
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+echo_i "checking recovery from forwarding to a non-recursive server"
+ret=0
+$DIG $DIGOPTS xxx.sld.tld txt @10.53.0.8  > dig.out.f8
+grep "status: NOERROR" dig.out.f8 > /dev/null || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1