ztoptions |= DNS_ZTFIND_NOEXACT;
result = dns_zt_find(view->zonetable, name, ztoptions,
NULL, &zone);
- } else
+ } else {
result = ISC_R_NOTFOUND;
+ }
UNLOCK(&view->lock);
if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH)
result = dns_zone_getdb(zone, &db);
* We have a cache; try it.
*/
dns_db_attach(view->cachedb, &db);
- } else {
+ } else if (use_hints && view->hints != NULL) {
/*
* Maybe we have hints...
*/
try_hints = true;
goto finish;
+ } else {
+ result = DNS_R_NXDOMAIN;
+ goto cleanup;
}
} else if (result != ISC_R_SUCCESS) {
/*
result = ISC_R_SUCCESS;
else if (result != ISC_R_SUCCESS)
goto cleanup;
+
if (use_cache && view->cachedb != NULL && db != view->hints) {
/*
* We found an answer, but the cache may be better.
* have a zone delegation, so use it.
*/
use_zone = true;
- } else {
+ result = ISC_R_SUCCESS;
+ } else if (use_hints && view->hints != NULL) {
/*
* Maybe we have hints...
*/
try_hints = true;
+ result = ISC_R_SUCCESS;
+ } else {
+ result = DNS_R_NXDOMAIN;
}
- result = ISC_R_SUCCESS;
} else {
/*
* Something bad happened.
if (sigrdataset != NULL &&
dns_rdataset_isassociated(&zrdataset))
dns_rdataset_clone(&zsigrdataset, sigrdataset);
- } else if (try_hints && use_hints && view->hints != NULL) {
+ } else if (try_hints) {
/*
* We've found nothing so far, but we have hints.
*/