diff --git a/bin/named/query.c b/bin/named/query.c index 608b24ace9..0cf832cd43 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -6529,6 +6529,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) isc_event_free(ISC_EVENT_PTR(&event)); } else if (REDIRECT(client)) { result = client->query.redirect.result; + is_zone = ISC_TF(result == DNS_R_NXDOMAIN); } else { result = event->result; } diff --git a/bin/tests/system/redirect/ns4/example.db.in b/bin/tests/system/redirect/ns4/example.db.in index e58564d72c..8aa5c7f954 100644 --- a/bin/tests/system/redirect/ns4/example.db.in +++ b/bin/tests/system/redirect/ns4/example.db.in @@ -15,5 +15,5 @@ $TTL 300 ; 5 minutes @ IN SOA ns.example.net hostmaster.example.net 0 0 0 0 0 @ NS ns4 -ns2 A 10.53.0.4 +ns4 A 10.53.0.4 a A 10.53.0.2 diff --git a/bin/tests/system/redirect/ns4/named.conf b/bin/tests/system/redirect/ns4/named.conf index c3bb0ee738..4370bee246 100644 --- a/bin/tests/system/redirect/ns4/named.conf +++ b/bin/tests/system/redirect/ns4/named.conf @@ -51,3 +51,8 @@ zone "." { type hint; file "root.hint"; }; + +zone "example" { + type master; + file "example.db"; +}; diff --git a/bin/tests/system/redirect/tests.sh b/bin/tests/system/redirect/tests.sh index d0e54497d7..7948415f21 100644 --- a/bin/tests/system/redirect/tests.sh +++ b/bin/tests/system/redirect/tests.sh @@ -486,5 +486,13 @@ n=`expr $n + 1` if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +echo "I:checking nxdomain-redirect against authoritative zone ($n)" +ret=0 +$DIG $DIGOPTS nonexist.example @10.53.0.4 -b 10.53.0.2 a > dig.out.ns4.test$n || ret=1 +grep "status: NOERROR" dig.out.ns4.test$n > /dev/null || ret=1 +n=`expr $n + 1` +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + echo "I:exit status: $status" exit $status