diff --git a/CHANGES b/CHANGES index e5db94f685..657b5bd238 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ + + 805. [bug] When using "forward only", missing root hints should + not cause queries to fail. [RT #1143] + 804. [bug] Attempting to obtain entropy could fail in some situations. This would be most common on systems with user-space threads. [RT #1131] diff --git a/bin/named/query.c b/bin/named/query.c index a833e20eac..8c878c4269 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.192 2001/04/04 18:47:06 bwelling Exp $ */ +/* $Id: query.c,v 1.193 2001/04/09 21:16:47 gson Exp $ */ #include @@ -2590,12 +2590,32 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) } if (result != ISC_R_SUCCESS) { /* - * We can't even find the hints for the root - * nameservers! + * We don't have any root server hints, but + * we may have working forwarders, so try to + * recurse anyway. */ - count_query(zone, is_zone, dns_statscounter_failure); - QUERY_ERROR(DNS_R_SERVFAIL); - goto cleanup; + if (RECURSIONOK(client)) { + count_query(zone, is_zone, + dns_statscounter_recursion); + result = query_recurse(client, qtype, + NULL, NULL); + if (result == ISC_R_SUCCESS) + client->query.attributes |= + NS_QUERYATTR_RECURSING; + else { + /* Unable to recurse. */ + count_query(zone, is_zone, + dns_statscounter_failure); + QUERY_ERROR(DNS_R_SERVFAIL); + } + goto cleanup; + } else { + /* Unable to give root server referral. */ + count_query(zone, is_zone, + dns_statscounter_failure); + QUERY_ERROR(DNS_R_SERVFAIL); + goto cleanup; + } } /* * XXXRTH We should trigger root server priming here.