310562
diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
310562
index 8696b15..5ef2dd6 100644
310562
--- a/lib/dns/resolver.c
310562
+++ b/lib/dns/resolver.c
310562
@@ -7373,9 +7373,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
310562
 		 * NXDOMAIN, NXRDATASET, or referral.
310562
 		 */
310562
 		result = noanswer_response(fctx, NULL, 0);
310562
-		if (result == DNS_R_CHASEDSSERVERS) {
310562
-		} else if (result == DNS_R_DELEGATION) {
310562
-		force_referral:
310562
+		switch (result) {
310562
+		case ISC_R_SUCCESS:
310562
+		case DNS_R_CHASEDSSERVERS:
310562
+			break;
310562
+		case DNS_R_DELEGATION:
310562
+ force_referral:
310562
 			/*
310562
 			 * We don't have the answer, but we know a better
310562
 			 * place to look.
310562
@@ -7400,7 +7403,8 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
310562
 			fctx->adberr = 0;
310562
 
310562
 			result = ISC_R_SUCCESS;
310562
-		} else if (result != ISC_R_SUCCESS) {
310562
+			break;
310562
+		default:
310562
 			/*
310562
 			 * Something has gone wrong.
310562
 			 */
310562
diff --git a/lib/dns/view.c b/lib/dns/view.c
310562
index 142b09e..35900b3 100644
310562
--- a/lib/dns/view.c
310562
+++ b/lib/dns/view.c
310562
@@ -1216,6 +1216,7 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
310562
 	dns_name_t *zfname;
310562
 	dns_rdataset_t zrdataset, zsigrdataset;
310562
 	dns_fixedname_t zfixedname;
310562
+	unsigned int ztoptions = 0;
310562
 
310562
 #ifndef BIND9
310562
 	UNUSED(zone);
310562
@@ -1242,9 +1243,12 @@ dns_view_findzonecut2(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
310562
 #ifdef BIND9
310562
 	zone = NULL;
310562
 	LOCK(&view->lock);
310562
-	if (view->zonetable != NULL)
310562
-		result = dns_zt_find(view->zonetable, name, 0, NULL, &zone);
310562
-	else
310562
+	if (view->zonetable != NULL) {
310562
+		if ((options & DNS_DBFIND_NOEXACT) != 0)
310562
+			ztoptions |= DNS_ZTFIND_NOEXACT;
310562
+		result = dns_zt_find(view->zonetable, name, ztoptions,
310562
+				     NULL, &zone);
310562
+	} else
310562
 		result = ISC_R_NOTFOUND;
310562
 	if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)
310562
 		result = dns_zone_getdb(zone, &db);