--- /dev/null
+; 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.
+
+@ SOA ns7 hostmaster.isc.org. 1 600 600 1200 600
+@ NS ns7
+ns7 A 10.53.0.7
type primary;
file "root.db";
};
+
+zone "from-no-cookie-server.example" {
+ type primary;
+ file "from-no-cookie-server.example.db";
+};
; See the COPYRIGHT file distributed with this work for additional
; information regarding copyright ownership.
-@ 3600 SOA . . 0 0 0 0 0
-@ 3600 NS .
+@ 3600 SOA . . 0 0 0 0 0
+@ 3600 NS .
+from-no-cookie-server 3600 NS ns7.from-no-cookie-server
+ns7.from-no-cookie-server 3600 A 10.53.0.7
require-server-cookie yes;
};
+server 10.53.0.7 { require-cookie yes; };
+
zone "example" {
type primary;
file "example.db";
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+n=`expr $n + 1`
+echo_i "checking 'server <prefix> { require-cookie yes; };' triggers TCP when cookie not returned ($n)"
+ret=0
+nextpart ns8/named.run > /dev/null
+$DIG $DIGOPTS +cookie soa from-no-cookie-server.example @10.53.0.8 > dig.out.test$n
+grep "status: NOERROR" dig.out.test$n > /dev/null || ret=1
+wait_for_log_peek 3 "missing required cookie from 10.53.0.7#" ns8/named.run || ret=1
+wait_for_log_peek 3 "from-no-cookie-server.example/SOA): connecting via TCP" ns8/named.run || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
n=`expr $n + 1`
echo_i "send undersized cookie ($n)"
ret=0