Test resolver-use-dns64

Test resolver-use-dns64 by simulating a connection to an IPv4-only
server through a NAT64.

This test uses EXTRAPORT1 rather than PORT for DNS traffic exchanged
between ns3 and ns4. Both servers also listen on PORT on their IPv4
addresses to support server startup testing in start.pl.
This commit is contained in:
Mark Andrews
2019-08-06 17:28:02 +10:00
parent 01b11c24ec
commit 3a87ff3dfe
6 changed files with 129 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
; 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.
$TTL 999999
. IN NS a.root-servers.nil.
a.root-servers.nil. IN A 10.53.0.4

View File

@@ -0,0 +1,46 @@
/*
* 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.
*/
// NS3
acl rfc1918 { 10/8; 192.168/16; 172.16/12; };
options {
query-source address 10.53.0.3;
query-source-v6 address fd92:7065:b8e:ffff::3;
notify-source 10.53.0.3;
notify-source-v6 fd92:7065:b8e:ffff::3;
transfer-source 10.53.0.3;
transfer-source-v6 fd92:7065:b8e:ffff::3;
port @EXTRAPORT1@;
pid-file "named.pid";
listen-on port @PORT@ { 10.53.0.3; }; // for start.pl
listen-on { 10.53.0.3; };
listen-on-v6 { fd92:7065:b8e:ffff::3; };
notify yes;
dnssec-validation yes;
allow-recursion { any; };
resolver-use-dns64 yes;
dns64 fd92:7065:b8e:fffe::/96 {
clients { any; };
mapped { 10.53.0.4; !rfc1918; any; };
suffix ::;
};
};
zone "." {
type hint;
file "hints";
};

View File

@@ -0,0 +1,36 @@
/*
* 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.
*/
// NS4
options {
query-source address 10.53.0.4;
query-source-v6 address fd92:7065:b8e:fffe::10.53.0.4;
notify-source 10.53.0.4;
notify-source-v6 fd92:7065:b8e:fffe::10.53.0.4;
transfer-source 10.53.0.4;
transfer-source-v6 fd92:7065:b8e:fffe::10.53.0.4;
port @EXTRAPORT1@;
pid-file "named.pid";
listen-on port @PORT@ { 10.53.0.4; }; // for start.pl
listen-on-v6 { fd92:7065:b8e:fffe::10.53.0.4; };
notify yes;
dnssec-validation yes;
recursion no;
};
zone "." {
type master;
file "root.db";
};

View File

@@ -0,0 +1,17 @@
; 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.
$TTL 999999
. IN SOA a.root-servers.nil. . 0 0 0 0 0
. IN NS a.root-servers.nil.
a.root-servers.nil. IN A 10.53.0.4
no-aaaa IN A 1.2.3.4
have-aaaa IN AAAA 2002::1

View File

@@ -15,5 +15,7 @@
copy_setports ns1/named.conf1.in ns1/named.conf
copy_setports ns2/named.conf.in ns2/named.conf
copy_setports ns3/named.conf.in ns3/named.conf
copy_setports ns4/named.conf.in ns4/named.conf
cd ns1 && $SHELL sign.sh

View File

@@ -1452,5 +1452,19 @@ n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
if $PERL ../testsock6.pl fd92:7065:b8e:fffe::10.53.0.4 2> /dev/null
then
echo_i "checking resolver-use-dns64 ($n)"
ret=0
$DIG $DIGOPTS @10.53.0.3 no-aaaa aaaa > dig.out.ns3.test$n || ret=1
grep "status: NOERROR" dig.out.ns3.test$n > /dev/null || ret=1
grep "fd92:7065:b8e:fffe::102:304" dig.out.ns3.test$n > /dev/null || ret=1
n=$((n + 1))
if [ $ret != 0 ]; then echo_i "failed"; fi
status=$((status + ret))
else
echo_i "skipped use-dns64 test - fd92:7065:b8e:fffe::10.53.0.4 not configured ($n)"
fi
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1