]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4015. [bug] Nameservers that are skipped due to them being
authorMark Andrews <marka@isc.org>
Wed, 3 Dec 2014 00:34:07 +0000 (11:34 +1100)
committerMark Andrews <marka@isc.org>
Wed, 3 Dec 2014 00:34:07 +0000 (11:34 +1100)
                        CNAMEs were not being logged. They are now logged
                        to category 'cname' as per BIND 8. [RT #37935]

13 files changed:
CHANGES
bin/tests/system/resolver/ns4/root.db
bin/tests/system/resolver/ns4/tld1.db
bin/tests/system/resolver/ns4/tld2.db
bin/tests/system/resolver/ns7/all-cnames.db [new file with mode: 0644]
bin/tests/system/resolver/ns7/named1.conf
bin/tests/system/resolver/ns7/named2.conf
bin/tests/system/resolver/tests.sh
doc/arm/Bv9ARM-book.xml
doc/arm/notes.xml
lib/dns/include/dns/log.h
lib/dns/log.c
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 83ff593050dcde0e5bd3cfe93926813226ab3d21..f2016cf78218c60fac6ce45dd60d419c6b5c0d3f 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
-4014.   [bug]           When including a master file origin_changed was
+4015.  [bug]           Nameservers that are skipped due to them being
+                       CNAMEs were not being logged. They are now logged
+                       to category 'cname' as per BIND 8. [RT #37935]
+
+4014.  [bug]           When including a master file origin_changed was
                        not being properly set leading to a potentially
                        spurious 'inherited owner' warning. [RT #37919]
 
index 212f0cf11a9b63bb25e36eb9c1346dcd58a82650..bd9228711818504bf330b0658abcc97be1f1bb7d 100644 (file)
@@ -24,3 +24,4 @@ $TTL 300
                                )
 .                      NS      a.root-servers.nil.
 a.root-servers.nil.    A       10.53.0.4
+all-cnames             NS      cname.tld
index 5f034f597a0e645666d1a151a72aa406a0ba3def..e9930bdfe2b5329cdfc6e784cdfced403272422a 100644 (file)
@@ -32,4 +32,5 @@ no-edns-version.tld.  NS      ns.no-edns-version.tld.
 ns.no-edns-version.tld.        A       10.53.0.6
 edns-version.tld.      NS      ns.edns-version.tld.
 ns.edns-version.tld.   A       10.53.0.7
-
+cname                  CNAME   ns7
+ns7                    A       10.53.0.7
index 338f61fbb787aab3c263ad44e0cb6ae1161b6a76..24c44855b7b94f04b37eafd078042ce514f86e91 100644 (file)
@@ -32,3 +32,5 @@ no-edns-version.tld.  NS      ns.no-edns-version.tld.
 ns.no-edns-version.tld.        A       10.53.0.6
 edns-version.tld.      NS      ns.edns-version.tld.
 ns.edns-version.tld.   A       10.53.0.7
+cname                  CNAME   ns7
+ns7                    A       10.53.0.7
diff --git a/bin/tests/system/resolver/ns7/all-cnames.db b/bin/tests/system/resolver/ns7/all-cnames.db
new file mode 100644 (file)
index 0000000..3b86c5b
--- /dev/null
@@ -0,0 +1,23 @@
+; Copyright (C) 2014  Internet Systems Consortium, Inc. ("ISC")
+;
+; Permission to use, copy, modify, and/or distribute this software for any
+; purpose with or without fee is hereby granted, provided that the above
+; copyright notice and this permission notice appear in all copies.
+;
+; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+; AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+; PERFORMANCE OF THIS SOFTWARE.
+
+$TTL 300
+@                      IN SOA  marka.isc.org. ns.server. (
+                               2010    ; serial
+                               600             ; refresh
+                               600             ; retry
+                               1200            ; expire
+                               600             ; minimum
+                               )
+@                      NS      cname.tld.
index 5572cf8646d78bcc64e5a58c62a99c011aeb8607..6f2b6556014e245e26808568be061dd841b4da9f 100644 (file)
@@ -57,3 +57,8 @@ zone "edns-version.tld" {
        type master;
        file "edns-version.tld.db";
 };
+
+zone "all-cnames" {
+       type master;
+       file "all-cnames.db";
+};
index daebe3d0e3770e7d91f810755f29f3a111d3af28..30c8a5a771d20220762ee83f762fcbd99d80ddb6 100644 (file)
@@ -57,3 +57,8 @@ zone "edns-version.tld" {
        type master;
        file "edns-version.tld.db";
 };
+
+zone "all-cnames" {
+       type master;
+       file "all-cnames.db";
+};
index 8bde7df34508ae2264a6f8a62f935bc6162c8292..cd9f922d753531d4e784dd0e8e347d740655b0a8 100755 (executable)
@@ -527,5 +527,14 @@ if test ${edns:-0} != 0; then
     status=`expr $status + $ret`
 fi
 
+n=`expr $n + 1`
+echo "I:check that CNAME nameserver is logged correctly (${n})"
+ret=0
+$DIG soa all-cnames @10.53.0.5 -p 5300 > dig.out.ns5.test${n} || ret=1
+grep "status: SERVFAIL" dig.out.ns5.test${n} > /dev/null || ret=1
+grep "skipping nameserver 'cname.tld' because it is a CNAME, while resolving 'all-cnames/SOA'" ns5/named.run > /dev/null || ret=1
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index dd1c5090a4f85810b70a908a442455df33deed49..398a68175bf723f3ffa99bc31c023b1d481107bf 100644 (file)
@@ -4355,6 +4355,17 @@ category notify { null; };
                    </para>
                  </entry>
                </row>
+               <row rowsep="0">
+                 <entry colname="1">
+                   <para><command>cname</command></para>
+                 </entry>
+                 <entry colname="2">
+                   <para>
+                     Logs nameservers that are skipped due to them being
+                     a CNAME rather than A / AAAA records.
+                   </para>
+                 </entry>
+               </row>
              </tbody>
            </tgroup>
          </informaltable>
index 8df5216f209ceff349157119b3f3b52df0146cd6..dfc45f26dc913b6a0dca3a7ac0b00d49360d4cdf 100644 (file)
           to make it easier to diagnose problems.
         </para>
       </listitem>
+      <listitem>
+       <para>
+         When encountering an authoritative name server whose name is
+         an alias pointing to another name, the resolver treats
+         this as an error and skips to the next server. Previously
+         this happened silently; now the error will be logged to
+         the newly-created "cname" log category.
+       </para>
+      </listitem>
     </itemizedlist>
   </sect2>
   <sect2 id="relnotes_bugs">
index c8d0b59b895ceaa7a1d6efb299a0641c3259aa09..bbaac0895d652d4c2e2ffee8c1cd3ad377a46939 100644 (file)
@@ -44,6 +44,7 @@ LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[];
 #define DNS_LOGCATEGORY_EDNS_DISABLED  (&dns_categories[11])
 #define DNS_LOGCATEGORY_RPZ            (&dns_categories[12])
 #define DNS_LOGCATEGORY_RRL            (&dns_categories[13])
+#define DNS_LOGCATEGORY_CNAME          (&dns_categories[14])
 
 /* Backwards compatibility. */
 #define DNS_LOGCATEGORY_GENERAL                ISC_LOGCATEGORY_GENERAL
index 663d420338508482f920bd1ed33f37527a365fa0..56d2bfb6b774bdfed4fde6fa59a18295c7141f64 100644 (file)
@@ -46,6 +46,7 @@ LIBDNS_EXTERNAL_DATA isc_logcategory_t dns_categories[] = {
        { "edns-disabled", 0 },
        { "rpz",        0 },
        { "rate-limit", 0 },
+       { "cname",      0 },
        { NULL,         0 }
 };
 
index 347cd7026407864dfb8a0f7eddb211aba7dfb54d..9af58d49764213ae35d68d6cc89d1b4afdaf7183 100644 (file)
@@ -2838,11 +2838,19 @@ findname(fetchctx_t *fctx, dns_name_t *name, in_port_t port,
                                     fctx->depth + 1, fctx->qc, &find);
        if (result != ISC_R_SUCCESS) {
                if (result == DNS_R_ALIAS) {
+                       char namebuf[DNS_NAME_FORMATSIZE];
+
                        /*
                         * XXXRTH  Follow the CNAME/DNAME chain?
                         */
                        dns_adb_destroyfind(&find);
                        fctx->adberr++;
+                       dns_name_format(name, namebuf, sizeof(namebuf));
+                       isc_log_write(dns_lctx, DNS_LOGCATEGORY_CNAME,
+                                     DNS_LOGMODULE_RESOLVER, ISC_LOG_INFO,
+                                     "skipping nameserver '%s' because it "
+                                     "is a CNAME, while resolving '%s'",
+                                     namebuf, fctx->info);
                }
        } else if (!ISC_LIST_EMPTY(find->list)) {
                /*