]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
805. [bug] When using "forward only", missing root hints should
authorAndreas Gustafsson <source@isc.org>
Mon, 9 Apr 2001 21:16:47 +0000 (21:16 +0000)
committerAndreas Gustafsson <source@isc.org>
Mon, 9 Apr 2001 21:16:47 +0000 (21:16 +0000)
                        not cause queries to fail. [RT #1143]

CHANGES
bin/named/query.c

diff --git a/CHANGES b/CHANGES
index e5db94f68510224a9487a9cfb8f79970d74c3c3c..657b5bd238b8605023e9d29ba6da879adcb778c3 100644 (file)
--- 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]
index a833e20eac90e386fb156d73569041275be1dee3..8c878c42692c7e248e0302e8a4482c566548e47e 100644 (file)
@@ -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 <config.h>
 
@@ -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.