]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Recurse to find the root server list with 'dig +trace'.
authorMark Andrews <marka@isc.org>
Tue, 14 May 2019 01:38:13 +0000 (11:38 +1000)
committerMark Andrews <marka@isc.org>
Wed, 22 May 2019 06:06:46 +0000 (16:06 +1000)
(cherry picked from commit e65d4989a138c7a4c196a8137524453a7fedae20)

CHANGES
bin/dig/dig.c
bin/dig/dig.docbook
bin/dig/dighost.c

diff --git a/CHANGES b/CHANGES
index d9a0054703a50b2a068e003241adb5baa757de50..6c07cac01cf6392430882a63edef06c6937c6449 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5237.  [bug]           Recurse to find the root server list with 'dig +trace'.
+                       [GL #1028]
+
        --- 9.11.7 released ---
 
 5233.  [bug]           Negative trust anchors did not work with "forward only;"
index 2063a3b5db0b9544c67ac123452e6431af049892..ad2bc2dbed23b0631c78c2a114e981593ce8775d 100644 (file)
@@ -1431,7 +1431,7 @@ plus_option(const char *option, bool is_batchfile,
                                lookup->trace = state;
                                lookup->trace_root = state;
                                if (state) {
-                                       lookup->recurse = false;
+                                       lookup->recurse = true;
                                        lookup->identify = true;
                                        lookup->comments = false;
                                        rrcomments = 0;
index 5d1930176145cdc8b8a6e28faaba45bb4168f8dc..17c9fc82c4b9dd663f927daa8fffb1549123e098 100644 (file)
              in the query.  This bit is set by default, which means
              <command>dig</command> normally sends recursive
              queries.  Recursion is automatically disabled when
-             the <parameter>+nssearch</parameter> or
-             <parameter>+trace</parameter> query options are used.
+             using the <parameter>+nssearch</parameter> option, and
+             when using <parameter>+trace</parameter> except for
+             an initial recursive query to get the list of root
+             servers.
            </para>
          </listitem>
        </varlistentry>
index c06c804141542b59541d88af7d271e885eaeb63d..7622bcd35194645143e0d97ae668189b8543d0c5 100644 (file)
@@ -2542,12 +2542,14 @@ setup_lookup(dig_lookup_t *lookup) {
        lookup->sendmsg->id = (unsigned short)id & 0xFFFF;
        lookup->sendmsg->opcode = lookup->opcode;
        lookup->msgcounter = 0;
+
        /*
-        * If this is a trace request, completely disallow recursion, since
-        * it's meaningless for traces.
+        * If this is a trace request, completely disallow recursion after
+        * looking up the root name servers, since it's meaningless for traces.
         */
-       if (lookup->trace || (lookup->ns_search_only && !lookup->trace_root))
+       if ((lookup->trace || lookup->ns_search_only) && !lookup->trace_root) {
                lookup->recurse = false;
+       }
 
        if (lookup->recurse &&
            lookup->rdtype != dns_rdatatype_axfr &&