example3 NS ns.example3
ns.example3 A 10.53.0.1
+
+example7 NS ns.example7
+ns.example7 A 10.53.0.2
file "example.db";
};
+zone "example7." {
+ type master;
+ file "example.db";
+};
+
zone "grafted." {
type master;
file "example.db";
forward only;
forwarders { };
};
+
+zone "example7." {
+ type forward;
+ forward first;
+ forwarders { 10.53.0.6; };
+};
. $SYSTEMTESTTOP/conf.sh
DIGOPTS="-p ${PORT}"
+SENDCMD="$PERL ../send.pl 10.53.0.6 $EXTRAPORT1"
root=10.53.0.1
hidden=10.53.0.2
if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret`
+echo_i "checking that a forwarder timeout prevents it from being reused in the same fetch context"
+ret=0
+# Make ans6 receive queries without responding to them.
+echo "//" | $SENDCMD
+# Query for a record in a zone which is forwarded to a non-responding forwarder
+# and is delegated from the root to check whether the forwarder will be retried
+# when a delegation is encountered after falling back to full recursive
+# resolution.
+$DIG $DIGOPTS txt.example7. txt @$f1 > dig.out.f1 || ret=1
+# The forwarder for the "example7" zone should only be queried once.
+sent=`sed -n '/sending packet to 10.53.0.6/,/^$/p' ns3/named.run | grep ";txt.example7.*IN.*TXT" | wc -l`
+if [ $sent -ne 1 ]; then ret=1; fi
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1
typedef enum {
badns_unreachable = 0,
badns_response,
- badns_validation
+ badns_validation,
+ badns_forwarder,
} badnstype_t;
struct fetchctx {
else
dns_adb_timeout(fctx->adb, query->addrinfo);
+ /*
+ * If "forward first;" is used and a forwarder timed
+ * out, do not attempt to query it again in this fetch
+ * context.
+ */
+ if (fctx->fwdpolicy == dns_fwdpolicy_first &&
+ ISFORWARDER(query->addrinfo))
+ {
+ add_bad(fctx, query->addrinfo, ISC_R_TIMEDOUT,
+ badns_forwarder);
+ }
+
/*
* We don't have an RTT for this query. Maybe the
* packet was lost, or maybe this server is very
break;
case badns_validation:
break; /* counted as 'valfail' */
+ case badns_forwarder:
+ /*
+ * We were called to prevent the given forwarder from
+ * being used again for this fetch context.
+ */
+ break;
}
}
./bin/tests/system/formerr/setup.sh SH 2018,2019
./bin/tests/system/formerr/tests.sh SH 2013,2015,2016,2018,2019
./bin/tests/system/formerr/twoquestions X 2013,2018,2019
+./bin/tests/system/forward/ans6/startme X 2019
./bin/tests/system/forward/clean.sh SH 2000,2001,2004,2007,2012,2014,2015,2016,2018,2019
./bin/tests/system/forward/ns1/example.db X 2000,2001,2018
./bin/tests/system/forward/ns2/example.db X 2000,2001,2018