Home | History | Annotate | Line # | Download | only in dnssec-guide
      1  1.1.1.2  christos .. Copyright (C) Internet Systems Consortium, Inc. ("ISC")
      2  1.1.1.2  christos ..
      3  1.1.1.2  christos .. SPDX-License-Identifier: MPL-2.0
      4  1.1.1.2  christos ..
      5  1.1.1.2  christos .. This Source Code Form is subject to the terms of the Mozilla Public
      6  1.1.1.2  christos .. License, v. 2.0.  If a copy of the MPL was not distributed with this
      7  1.1.1.2  christos .. file, you can obtain one at https://mozilla.org/MPL/2.0/.
      8  1.1.1.2  christos ..
      9  1.1.1.2  christos .. See the COPYRIGHT file distributed with this work for additional
     10  1.1.1.2  christos .. information regarding copyright ownership.
     11      1.1  christos 
     12      1.1  christos .. _dnssec_troubleshooting:
     13      1.1  christos 
     14      1.1  christos Basic DNSSEC Troubleshooting
     15      1.1  christos ----------------------------
     16      1.1  christos 
     17      1.1  christos In this chapter, we cover some basic troubleshooting
     18      1.1  christos techniques, some common DNSSEC symptoms, and their causes and solutions. This
     19      1.1  christos is not a comprehensive "how to troubleshoot any DNS or DNSSEC problem"
     20      1.1  christos guide, because that could easily be an entire book by itself.
     21      1.1  christos 
     22      1.1  christos .. _troubleshooting_query_path:
     23      1.1  christos 
     24      1.1  christos Query Path
     25      1.1  christos ~~~~~~~~~~
     26      1.1  christos 
     27      1.1  christos The first step in troubleshooting DNS or DNSSEC should be to
     28      1.1  christos determine the query path. Whenever you are working with a DNS-related issue, it is
     29      1.1  christos always a good idea to determine the exact query path to identify the
     30      1.1  christos origin of the problem.
     31      1.1  christos 
     32      1.1  christos End clients, such as laptop computers or mobile phones, are configured
     33      1.1  christos to talk to a recursive name server, and the recursive name server may in
     34      1.1  christos turn forward requests on to other recursive name servers before arriving at the
     35      1.1  christos authoritative name server. The giveaway is the presence of the
     36      1.1  christos Authoritative Answer (``aa``) flag in a query response: when present, we know we are talking
     37      1.1  christos to the authoritative server; when missing, we are talking to a recursive
     38      1.1  christos server. The example below shows an answer to a query for
     39      1.1  christos ``www.example.com`` without the Authoritative Answer flag:
     40      1.1  christos 
     41      1.1  christos ::
     42      1.1  christos 
     43      1.1  christos    $ dig @10.53.0.3 www.example.com A
     44      1.1  christos 
     45      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.3 www.example.com a
     46      1.1  christos    ; (1 server found)
     47      1.1  christos    ;; global options: +cmd
     48      1.1  christos    ;; Got answer:
     49      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62714
     50      1.1  christos    ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
     51      1.1  christos 
     52      1.1  christos    ;; OPT PSEUDOSECTION:
     53      1.1  christos    ; EDNS: version: 0, flags:; udp: 4096
     54      1.1  christos    ; COOKIE: c823fe302625db5b010000005e722b504d81bb01c2227259 (good)
     55      1.1  christos    ;; QUESTION SECTION:
     56      1.1  christos    ;www.example.com.       IN  A
     57      1.1  christos 
     58      1.1  christos    ;; ANSWER SECTION:
     59      1.1  christos    www.example.com.    60  IN  A   10.1.0.1
     60      1.1  christos 
     61      1.1  christos    ;; Query time: 3 msec
     62      1.1  christos    ;; SERVER: 10.53.0.3#53(10.53.0.3)
     63      1.1  christos    ;; WHEN: Wed Mar 18 14:08:16 GMT 2020
     64      1.1  christos    ;; MSG SIZE  rcvd: 88
     65      1.1  christos 
     66      1.1  christos Not only do we not see the ``aa`` flag, we see an ``ra``
     67      1.1  christos flag, which indicates Recursion Available. This indicates that the
     68      1.1  christos server we are talking to (10.53.0.3 in this example) is a recursive name
     69      1.1  christos server: although we were able to get an answer for
     70      1.1  christos ``www.example.com``, we know that the answer came from somewhere else.
     71      1.1  christos 
     72      1.1  christos If we query the authoritative server directly, we get:
     73      1.1  christos 
     74      1.1  christos ::
     75      1.1  christos 
     76      1.1  christos    $ dig @10.53.0.2 www.example.com A
     77      1.1  christos 
     78      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.2 www.example.com a
     79      1.1  christos    ; (1 server found)
     80      1.1  christos    ;; global options: +cmd
     81      1.1  christos    ;; Got answer:
     82      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39542
     83      1.1  christos    ;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
     84      1.1  christos    ;; WARNING: recursion requested but not available
     85      1.1  christos    ...
     86      1.1  christos 
     87      1.1  christos The ``aa`` flag tells us that we are now talking to the
     88      1.1  christos authoritative name server for ``www.example.com``, and that this is not a
     89      1.1  christos cached answer it obtained from some other name server; it served this
     90      1.1  christos answer to us right from its own database. In fact,
     91      1.1  christos the Recursion Available (``ra``) flag is not present, which means this
     92      1.1  christos name server is not configured to perform recursion (at least not for
     93      1.1  christos this client), so it could not have queried another name server to get
     94      1.1  christos cached results.
     95      1.1  christos 
     96      1.1  christos .. _troubleshooting_visible_symptoms:
     97      1.1  christos 
     98      1.1  christos Visible DNSSEC Validation Symptoms
     99      1.1  christos ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    100      1.1  christos 
    101      1.1  christos After determining the query path, it is necessary to
    102      1.1  christos determine whether the problem is actually related to DNSSEC
    103  1.1.1.3  christos validation. You can use the :option:`dig +cd` flag to disable
    104      1.1  christos validation, as described in
    105      1.1  christos :ref:`how_do_i_know_validation_problem`.
    106      1.1  christos 
    107      1.1  christos When there is indeed a DNSSEC validation problem, the visible symptoms,
    108      1.1  christos unfortunately, are very limited. With DNSSEC validation enabled, if a
    109      1.1  christos DNS response is not fully validated, it results in a generic
    110      1.1  christos SERVFAIL message, as shown below when querying against a recursive name
    111      1.1  christos server at 192.168.1.7:
    112      1.1  christos 
    113      1.1  christos ::
    114      1.1  christos 
    115      1.1  christos    $ dig @10.53.0.3 www.example.org. A
    116      1.1  christos 
    117      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.3 www.example.org A
    118      1.1  christos    ; (1 server found)
    119      1.1  christos    ;; global options: +cmd
    120      1.1  christos    ;; Got answer:
    121      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 28947
    122      1.1  christos    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    123      1.1  christos 
    124      1.1  christos    ;; OPT PSEUDOSECTION:
    125      1.1  christos    ; EDNS: version: 0, flags:; udp: 4096
    126      1.1  christos    ; COOKIE: d1301968aca086ad010000005e723a7113603c01916d136b (good)
    127      1.1  christos    ;; QUESTION SECTION:
    128      1.1  christos    ;www.example.org.       IN  A
    129      1.1  christos 
    130      1.1  christos    ;; Query time: 3 msec
    131      1.1  christos    ;; SERVER: 10.53.0.3#53(10.53.0.3)
    132      1.1  christos    ;; WHEN: Wed Mar 18 15:12:49 GMT 2020
    133      1.1  christos    ;; MSG SIZE  rcvd: 72
    134      1.1  christos 
    135  1.1.1.3  christos With :iscman:`delv`, a "resolution failed" message is output instead:
    136      1.1  christos 
    137      1.1  christos ::
    138      1.1  christos 
    139      1.1  christos    $ delv @10.53.0.3 www.example.org. A +rtrace
    140      1.1  christos    ;; fetch: www.example.org/A
    141      1.1  christos    ;; resolution failed: SERVFAIL
    142  1.1.1.3  christos 
    143      1.1  christos BIND 9 logging features may be useful when trying to identify
    144      1.1  christos DNSSEC errors.
    145      1.1  christos 
    146      1.1  christos .. _troubleshooting_logging:
    147      1.1  christos 
    148      1.1  christos Basic Logging
    149      1.1  christos ~~~~~~~~~~~~~
    150      1.1  christos 
    151  1.1.1.3  christos DNSSEC validation error messages show up in :any:`syslog` as a
    152      1.1  christos query error by default. Here is an example of what it may look like:
    153      1.1  christos 
    154      1.1  christos ::
    155      1.1  christos 
    156      1.1  christos    validating www.example.org/A: no valid signature found
    157      1.1  christos    RRSIG failed to verify resolving 'www.example.org/A/IN': 10.53.0.2#53
    158      1.1  christos 
    159      1.1  christos Usually, this level of error logging is sufficient.
    160      1.1  christos Debug logging, described in
    161      1.1  christos :ref:`troubleshooting_logging_debug`, gives information on how
    162      1.1  christos to get more details about why DNSSEC validation may have
    163      1.1  christos failed.
    164      1.1  christos 
    165      1.1  christos .. _troubleshooting_logging_debug:
    166      1.1  christos 
    167      1.1  christos BIND DNSSEC Debug Logging
    168      1.1  christos ~~~~~~~~~~~~~~~~~~~~~~~~~
    169      1.1  christos 
    170      1.1  christos A word of caution: before you enable debug logging, be aware that this
    171      1.1  christos may dramatically increase the load on your name servers. Enabling debug
    172      1.1  christos logging is thus not recommended for production servers.
    173      1.1  christos 
    174      1.1  christos With that said, sometimes it may become necessary to temporarily enable
    175      1.1  christos BIND debug logging to see more details of how and whether DNSSEC is
    176  1.1.1.3  christos validating. DNSSEC-related messages are not recorded in :any:`syslog` by default,
    177  1.1.1.3  christos even if query log is enabled; only DNSSEC errors show up in :any:`syslog`.
    178      1.1  christos 
    179      1.1  christos The example below shows how to enable debug level 3 (to see full DNSSEC
    180  1.1.1.3  christos validation messages) in BIND 9 and have it sent to :any:`syslog`:
    181      1.1  christos 
    182      1.1  christos ::
    183      1.1  christos 
    184      1.1  christos    logging {
    185      1.1  christos       channel dnssec_log {
    186      1.1  christos            syslog daemon;
    187      1.1  christos            severity debug 3;
    188      1.1  christos            print-category yes;
    189      1.1  christos        };
    190      1.1  christos        category dnssec { dnssec_log; };
    191      1.1  christos    };
    192      1.1  christos 
    193      1.1  christos The example below shows how to log DNSSEC messages to their own file
    194      1.1  christos (here, ``/var/log/dnssec.log``):
    195      1.1  christos 
    196      1.1  christos ::
    197      1.1  christos 
    198      1.1  christos    logging {
    199      1.1  christos        channel dnssec_log {
    200      1.1  christos            file "/var/log/dnssec.log";
    201      1.1  christos            severity debug 3;
    202      1.1  christos        };
    203      1.1  christos        category dnssec { dnssec_log; };
    204      1.1  christos    };
    205      1.1  christos 
    206      1.1  christos After turning on debug logging and restarting BIND, a large
    207      1.1  christos number of log messages appear in
    208  1.1.1.3  christos :any:`syslog`. The example below shows the log messages as a result of
    209      1.1  christos successfully looking up and validating the domain name ``ftp.isc.org``.
    210      1.1  christos 
    211      1.1  christos ::
    212      1.1  christos 
    213      1.1  christos    validating ./NS: starting
    214      1.1  christos    validating ./NS: attempting positive response validation
    215      1.1  christos      validating ./DNSKEY: starting
    216      1.1  christos      validating ./DNSKEY: attempting positive response validation
    217      1.1  christos      validating ./DNSKEY: verify rdataset (keyid=20326): success
    218      1.1  christos      validating ./DNSKEY: marking as secure (DS)
    219      1.1  christos    validating ./NS: in validator_callback_dnskey
    220      1.1  christos    validating ./NS: keyset with trust secure
    221      1.1  christos    validating ./NS: resuming validate
    222      1.1  christos    validating ./NS: verify rdataset (keyid=33853): success
    223      1.1  christos    validating ./NS: marking as secure, noqname proof not needed
    224      1.1  christos    validating ftp.isc.org/A: starting
    225      1.1  christos    validating ftp.isc.org/A: attempting positive response validation
    226      1.1  christos    validating isc.org/DNSKEY: starting
    227      1.1  christos    validating isc.org/DNSKEY: attempting positive response validation
    228      1.1  christos      validating isc.org/DS: starting
    229      1.1  christos      validating isc.org/DS: attempting positive response validation
    230      1.1  christos    validating org/DNSKEY: starting
    231      1.1  christos    validating org/DNSKEY: attempting positive response validation
    232      1.1  christos      validating org/DS: starting
    233      1.1  christos      validating org/DS: attempting positive response validation
    234      1.1  christos      validating org/DS: keyset with trust secure
    235      1.1  christos      validating org/DS: verify rdataset (keyid=33853): success
    236      1.1  christos      validating org/DS: marking as secure, noqname proof not needed
    237      1.1  christos    validating org/DNSKEY: in validator_callback_ds
    238      1.1  christos    validating org/DNSKEY: dsset with trust secure
    239      1.1  christos    validating org/DNSKEY: verify rdataset (keyid=9795): success
    240      1.1  christos    validating org/DNSKEY: marking as secure (DS)
    241      1.1  christos      validating isc.org/DS: in fetch_callback_dnskey
    242      1.1  christos      validating isc.org/DS: keyset with trust secure
    243      1.1  christos      validating isc.org/DS: resuming validate
    244      1.1  christos      validating isc.org/DS: verify rdataset (keyid=33209): success
    245      1.1  christos      validating isc.org/DS: marking as secure, noqname proof not needed
    246      1.1  christos    validating isc.org/DNSKEY: in validator_callback_ds
    247      1.1  christos    validating isc.org/DNSKEY: dsset with trust secure
    248      1.1  christos    validating isc.org/DNSKEY: verify rdataset (keyid=7250): success
    249      1.1  christos    validating isc.org/DNSKEY: marking as secure (DS)
    250      1.1  christos    validating ftp.isc.org/A: in fetch_callback_dnskey
    251      1.1  christos    validating ftp.isc.org/A: keyset with trust secure
    252      1.1  christos    validating ftp.isc.org/A: resuming validate
    253      1.1  christos    validating ftp.isc.org/A: verify rdataset (keyid=27566): success
    254      1.1  christos    validating ftp.isc.org/A: marking as secure, noqname proof not needed
    255      1.1  christos 
    256      1.1  christos Note that these log messages indicate that the chain of trust has been
    257      1.1  christos established and ``ftp.isc.org`` has been successfully validated.
    258      1.1  christos 
    259      1.1  christos If validation had failed, you would see log messages indicating errors.
    260      1.1  christos We cover some of the most validation problems in the next section.
    261      1.1  christos 
    262      1.1  christos .. _troubleshooting_common_problems:
    263      1.1  christos 
    264      1.1  christos Common Problems
    265      1.1  christos ~~~~~~~~~~~~~~~
    266      1.1  christos 
    267      1.1  christos .. _troubleshooting_security_lameness:
    268      1.1  christos 
    269      1.1  christos Security Lameness
    270      1.1  christos ^^^^^^^^^^^^^^^^^
    271      1.1  christos 
    272      1.1  christos Similar to lame delegation in traditional DNS, security lameness refers to the
    273      1.1  christos condition when the parent zone holds a set of DS records that point to
    274      1.1  christos something that does not exist in the child zone. As a result,
    275      1.1  christos the entire child zone may "disappear," having been marked as bogus by
    276      1.1  christos validating resolvers.
    277      1.1  christos 
    278      1.1  christos Below is an example attempting to resolve the A record for a test domain
    279      1.1  christos name ``www.example.net``. From the user's perspective, as described in
    280      1.1  christos :ref:`how_do_i_know_validation_problem`, only a SERVFAIL
    281      1.1  christos message is returned. On the validating resolver, we see the
    282  1.1.1.3  christos following messages in :any:`syslog`:
    283      1.1  christos 
    284      1.1  christos ::
    285      1.1  christos 
    286      1.1  christos    named[126063]: validating example.net/DNSKEY: no valid signature found (DS)
    287      1.1  christos    named[126063]: no valid RRSIG resolving 'example.net/DNSKEY/IN': 10.53.0.2#53
    288      1.1  christos    named[126063]: broken trust chain resolving 'www.example.net/A/IN': 10.53.0.2#53
    289      1.1  christos 
    290      1.1  christos This gives us a hint that it is a broken trust chain issue. Let's take a
    291      1.1  christos look at the DS records that are published for the zone (with the keys
    292      1.1  christos shortened for ease of display):
    293      1.1  christos 
    294      1.1  christos ::
    295      1.1  christos 
    296      1.1  christos    $ dig @10.53.0.3 example.net. DS
    297      1.1  christos 
    298      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.3 example.net DS
    299      1.1  christos    ; (1 server found)
    300      1.1  christos    ;; global options: +cmd
    301      1.1  christos    ;; Got answer:
    302      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59602
    303      1.1  christos    ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    304      1.1  christos 
    305      1.1  christos    ;; OPT PSEUDOSECTION:
    306      1.1  christos    ; EDNS: version: 0, flags:; udp: 4096
    307      1.1  christos    ; COOKIE: 7026d8f7c6e77e2a010000005e735d7c9d038d061b2d24da (good)
    308      1.1  christos    ;; QUESTION SECTION:
    309      1.1  christos    ;example.net.           IN  DS
    310      1.1  christos 
    311      1.1  christos    ;; ANSWER SECTION:
    312      1.1  christos    example.net.        256 IN  DS  14956 8 2 9F3CACD...D3E3A396
    313      1.1  christos 
    314      1.1  christos    ;; Query time: 0 msec
    315      1.1  christos    ;; SERVER: 10.53.0.3#53(10.53.0.3)
    316      1.1  christos    ;; WHEN: Thu Mar 19 11:54:36 GMT 2020
    317      1.1  christos    ;; MSG SIZE  rcvd: 116
    318      1.1  christos 
    319      1.1  christos Next, we query for the DNSKEY and RRSIG of ``example.net`` to see if
    320      1.1  christos there's anything wrong. Since we are having trouble validating, we
    321  1.1.1.3  christos can use the :option:`dig +cd` option to temporarily disable checking and return
    322      1.1  christos results, even though they do not pass the validation tests. The
    323  1.1.1.3  christos :option:`dig +multiline` option causes :iscman:`dig` to print the type, algorithm type,
    324      1.1  christos and key id for DNSKEY records. Again,
    325      1.1  christos some long strings are shortened for ease of display:
    326      1.1  christos 
    327      1.1  christos ::
    328      1.1  christos 
    329      1.1  christos    $ dig @10.53.0.3 example.net. DNSKEY +dnssec +cd +multiline
    330      1.1  christos 
    331      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.3 example.net DNSKEY +cd +multiline +dnssec
    332      1.1  christos    ; (1 server found)
    333      1.1  christos    ;; global options: +cmd
    334      1.1  christos    ;; Got answer:
    335      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42980
    336      1.1  christos    ;; flags: qr rd ra cd; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1
    337      1.1  christos 
    338      1.1  christos    ;; OPT PSEUDOSECTION:
    339      1.1  christos    ; EDNS: version: 0, flags: do; udp: 4096
    340      1.1  christos    ; COOKIE: 4b5e7c88b3680c35010000005e73722057551f9f8be1990e (good)
    341      1.1  christos    ;; QUESTION SECTION:
    342      1.1  christos    ;example.net.       IN DNSKEY
    343      1.1  christos 
    344      1.1  christos    ;; ANSWER SECTION:
    345      1.1  christos    example.net.        287 IN DNSKEY 256 3 8 (
    346      1.1  christos                    AwEAAbu3NX...ADU/D7xjFFDu+8WRIn
    347      1.1  christos                    ) ; ZSK; alg = RSASHA256 ; key id = 35328
    348      1.1  christos    example.net.        287 IN DNSKEY 257 3 8 (
    349      1.1  christos                    AwEAAbKtU1...PPP4aQZTybk75ZW+uL
    350      1.1  christos                    6OJMAF63NO0s1nAZM2EWAVasbnn/X+J4N2rLuhk=
    351      1.1  christos                    ) ; KSK; alg = RSASHA256 ; key id = 27247
    352      1.1  christos    example.net.        287 IN RRSIG DNSKEY 8 2 300 (
    353      1.1  christos                    20811123173143 20180101000000 27247 example.net.
    354      1.1  christos                    Fz1sjClIoF...YEjzpAWuAj9peQ== )
    355      1.1  christos    example.net.        287 IN RRSIG DNSKEY 8 2 300 (
    356      1.1  christos                    20811123173143 20180101000000 35328 example.net.
    357      1.1  christos                    seKtUeJ4/l...YtDc1rcXTVlWIOw= )
    358      1.1  christos 
    359      1.1  christos    ;; Query time: 0 msec
    360      1.1  christos    ;; SERVER: 10.53.0.3#53(10.53.0.3)
    361      1.1  christos    ;; WHEN: Thu Mar 19 13:22:40 GMT 2020
    362      1.1  christos    ;; MSG SIZE  rcvd: 962
    363      1.1  christos 
    364      1.1  christos Here is the problem: the parent zone is telling the world that
    365      1.1  christos ``example.net`` is using the key 14956, but the authoritative server
    366      1.1  christos indicates that it is using keys 27247 and 35328. There are several
    367      1.1  christos potential causes for this mismatch: one possibility is that a malicious
    368      1.1  christos attacker has compromised one side and changed the data. A more likely
    369      1.1  christos scenario is that the DNS administrator for the child zone did not upload
    370      1.1  christos the correct key information to the parent zone.
    371      1.1  christos 
    372      1.1  christos .. _troubleshooting_incorrect_time:
    373      1.1  christos 
    374      1.1  christos Incorrect Time
    375      1.1  christos ^^^^^^^^^^^^^^
    376      1.1  christos 
    377      1.1  christos In DNSSEC, every record comes with at least one RRSIG, and each RRSIG
    378      1.1  christos contains two timestamps: one indicating when it becomes valid, and
    379      1.1  christos one when it expires. If the validating resolver's current system time does
    380      1.1  christos not fall within the two RRSIG timestamps, error messages
    381      1.1  christos appear in the BIND debug log.
    382      1.1  christos 
    383      1.1  christos The example below shows a log message when the RRSIG appears to have
    384      1.1  christos expired. This could mean the validating resolver system time is
    385      1.1  christos incorrectly set too far in the future, or the zone administrator has not
    386      1.1  christos kept up with RRSIG maintenance.
    387      1.1  christos 
    388      1.1  christos ::
    389      1.1  christos 
    390      1.1  christos    validating example.com/DNSKEY: verify failed due to bad signature (keyid=19036): RRSIG has expired
    391      1.1  christos 
    392      1.1  christos The log below shows that the RRSIG validity period has not yet begun. This could mean
    393      1.1  christos the validation resolver's system time is incorrectly set too far in the past, or
    394      1.1  christos the zone administrator has incorrectly generated signatures for this
    395      1.1  christos domain name.
    396      1.1  christos 
    397      1.1  christos ::
    398      1.1  christos 
    399      1.1  christos    validating example.com/DNSKEY: verify failed due to bad signature (keyid=4521): RRSIG validity period has not begun
    400      1.1  christos 
    401      1.1  christos .. _troubleshooting_unable_to_load_keys:
    402      1.1  christos 
    403      1.1  christos Unable to Load Keys
    404      1.1  christos ^^^^^^^^^^^^^^^^^^^
    405      1.1  christos 
    406      1.1  christos This is a simple yet common issue. If the key files are present but
    407  1.1.1.3  christos unreadable by :iscman:`named` for some reason, the :any:`syslog` returns clear error
    408      1.1  christos messages, as shown below:
    409      1.1  christos 
    410      1.1  christos ::
    411      1.1  christos 
    412      1.1  christos    named[32447]: zone example.com/IN (signed): reconfiguring zone keys
    413      1.1  christos    named[32447]: dns_dnssec_findmatchingkeys: error reading key file Kexample.com.+008+06817.private: permission denied
    414      1.1  christos    named[32447]: dns_dnssec_findmatchingkeys: error reading key file Kexample.com.+008+17694.private: permission denied
    415      1.1  christos    named[32447]: zone example.com/IN (signed): next key event: 27-Nov-2014 20:04:36.521
    416      1.1  christos 
    417      1.1  christos However, if no keys are found, the error is not as obvious. Below shows
    418  1.1.1.3  christos the :any:`syslog` messages after executing ``rndc
    419      1.1  christos reload`` with the key files missing from the key directory:
    420      1.1  christos 
    421      1.1  christos ::
    422      1.1  christos 
    423      1.1  christos    named[32516]: received control channel command 'reload'
    424      1.1  christos    named[32516]: loading configuration from '/etc/bind/named.conf'
    425      1.1  christos    named[32516]: using default UDP/IPv4 port range: [1024, 65535]
    426      1.1  christos    named[32516]: using default UDP/IPv6 port range: [1024, 65535]
    427      1.1  christos    named[32516]: sizing zone task pool based on 6 zones
    428      1.1  christos    named[32516]: the working directory is not writable
    429      1.1  christos    named[32516]: reloading configuration succeeded
    430      1.1  christos    named[32516]: reloading zones succeeded
    431      1.1  christos    named[32516]: all zones loaded
    432      1.1  christos    named[32516]: running
    433      1.1  christos    named[32516]: zone example.com/IN (signed): reconfiguring zone keys
    434      1.1  christos    named[32516]: zone example.com/IN (signed): next key event: 27-Nov-2014 20:07:09.292
    435      1.1  christos 
    436      1.1  christos This happens to look exactly the same as if the keys were present and
    437  1.1.1.3  christos readable, and appears to indicate that :iscman:`named` loaded the keys and signed the zone. It
    438      1.1  christos even generates the internal (raw) files:
    439      1.1  christos 
    440      1.1  christos ::
    441      1.1  christos 
    442      1.1  christos    # cd /etc/bind/db
    443      1.1  christos    # ls
    444      1.1  christos    example.com.db  example.com.db.jbk  example.com.db.signed
    445      1.1  christos 
    446  1.1.1.3  christos If :iscman:`named` really loaded the keys and signed the zone, you should see
    447      1.1  christos the following files:
    448      1.1  christos 
    449      1.1  christos ::
    450      1.1  christos 
    451      1.1  christos    # cd /etc/bind/db
    452      1.1  christos    # ls
    453      1.1  christos    example.com.db  example.com.db.jbk  example.com.db.signed  example.com.db.signed.jnl
    454      1.1  christos 
    455      1.1  christos So, unless you see the ``*.signed.jnl`` file, your zone has not been
    456      1.1  christos signed.
    457      1.1  christos 
    458      1.1  christos .. _troubleshooting_invalid_trust_anchors:
    459      1.1  christos 
    460      1.1  christos Invalid Trust Anchors
    461      1.1  christos ^^^^^^^^^^^^^^^^^^^^^
    462      1.1  christos 
    463      1.1  christos In most cases, you never need to explicitly configure trust
    464  1.1.1.3  christos anchors. :iscman:`named` supplies the current root trust anchor and,
    465  1.1.1.3  christos with the default setting of :any:`dnssec-validation`, updates it on the
    466      1.1  christos infrequent occasions when it is changed.
    467      1.1  christos 
    468      1.1  christos However, in some circumstances you may need to explicitly configure
    469      1.1  christos your own trust anchor. As we saw in the :ref:`trust_anchors_description`
    470      1.1  christos section, whenever a DNSKEY is received by the validating resolver, it is
    471      1.1  christos compared to the list of keys the resolver explicitly trusts to see if
    472      1.1  christos further action is needed. If the two keys match, the validating resolver
    473      1.1  christos stops performing further verification and returns the answer(s) as
    474      1.1  christos validated.
    475      1.1  christos 
    476      1.1  christos But what if the key file on the validating resolver is misconfigured or
    477      1.1  christos missing? Below we show some examples of log messages when things are not
    478      1.1  christos working properly.
    479      1.1  christos 
    480      1.1  christos First of all, if the key you copied is malformed, BIND does not even
    481      1.1  christos start and you will likely find this error message in syslog:
    482      1.1  christos 
    483      1.1  christos ::
    484      1.1  christos 
    485      1.1  christos    named[18235]: /etc/bind/named.conf.options:29: bad base64 encoding
    486      1.1  christos    named[18235]: loading configuration: failure
    487      1.1  christos 
    488      1.1  christos If the key is a valid base64 string but the key algorithm is incorrect,
    489      1.1  christos or if the wrong key is installed, the first thing you will notice is
    490      1.1  christos that virtually all of your DNS lookups result in SERVFAIL, even when
    491      1.1  christos you are looking up domain names that have not been DNSSEC-enabled. Below
    492      1.1  christos shows an example of querying a recursive server 10.53.0.3:
    493      1.1  christos 
    494      1.1  christos ::
    495      1.1  christos 
    496      1.1  christos    $ dig @10.53.0.3 www.example.com. A
    497      1.1  christos 
    498      1.1  christos    ; <<>> DiG 9.16.0 <<>> @10.53.0.3 www.example.org A +dnssec
    499      1.1  christos    ; (1 server found)
    500      1.1  christos    ;; global options: +cmd
    501      1.1  christos    ;; Got answer:
    502      1.1  christos    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29586
    503      1.1  christos    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
    504      1.1  christos 
    505      1.1  christos    ;; OPT PSEUDOSECTION:
    506      1.1  christos    ; EDNS: version: 0, flags: do; udp: 4096
    507      1.1  christos    ; COOKIE: ee078fc321fa1367010000005e73a58bf5f205ca47e04bed (good)
    508      1.1  christos    ;; QUESTION SECTION:
    509      1.1  christos    ;www.example.org.       IN  A
    510      1.1  christos 
    511  1.1.1.3  christos :iscman:`delv` shows a similar result:
    512      1.1  christos 
    513      1.1  christos ::
    514      1.1  christos 
    515      1.1  christos    $ delv @192.168.1.7 www.example.com. +rtrace
    516      1.1  christos    ;; fetch: www.example.com/A
    517      1.1  christos    ;; resolution failed: SERVFAIL
    518      1.1  christos 
    519      1.1  christos The next symptom you see is in the DNSSEC log messages:
    520      1.1  christos 
    521      1.1  christos ::
    522      1.1  christos 
    523      1.1  christos    managed-keys-zone: DNSKEY set for zone '.' could not be verified with current keys
    524      1.1  christos    validating ./DNSKEY: starting
    525      1.1  christos    validating ./DNSKEY: attempting positive response validation
    526      1.1  christos    validating ./DNSKEY: no DNSKEY matching DS
    527      1.1  christos    validating ./DNSKEY: no DNSKEY matching DS
    528      1.1  christos    validating ./DNSKEY: no valid signature found (DS)
    529      1.1  christos 
    530      1.1  christos These errors are indications that there are problems with the trust
    531      1.1  christos anchor.
    532      1.1  christos 
    533      1.1  christos .. _troubleshooting_nta:
    534      1.1  christos 
    535      1.1  christos Negative Trust Anchors
    536      1.1  christos ~~~~~~~~~~~~~~~~~~~~~~
    537      1.1  christos 
    538      1.1  christos BIND 9.11 introduced Negative Trust Anchors (NTAs) as a means to
    539      1.1  christos *temporarily* disable DNSSEC validation for a zone when you know that
    540      1.1  christos the zone's DNSSEC is misconfigured.
    541      1.1  christos 
    542  1.1.1.3  christos NTAs are added using the :iscman:`rndc` command, e.g.:
    543      1.1  christos 
    544      1.1  christos ::
    545      1.1  christos 
    546      1.1  christos    $ rndc nta example.com
    547      1.1  christos     Negative trust anchor added: example.com/_default, expires 19-Mar-2020 19:57:42.000
    548  1.1.1.3  christos 
    549      1.1  christos 
    550      1.1  christos The list of currently configured NTAs can also be examined using
    551  1.1.1.3  christos :iscman:`rndc`, e.g.:
    552      1.1  christos 
    553      1.1  christos ::
    554      1.1  christos 
    555      1.1  christos    $ rndc nta -dump
    556      1.1  christos     example.com/_default: expiry 19-Mar-2020 19:57:42.000
    557  1.1.1.3  christos 
    558      1.1  christos 
    559      1.1  christos The default lifetime of an NTA is one hour, although by default, BIND
    560      1.1  christos polls the zone every five minutes to see if the zone correctly
    561      1.1  christos validates, at which point the NTA automatically expires. Both the
    562      1.1  christos default lifetime and the polling interval may be configured via
    563  1.1.1.3  christos :iscman:`named.conf`, and the lifetime can be overridden on a per-zone basis
    564      1.1  christos using the ``-lifetime duration`` parameter to ``rndc nta``. Both timer
    565      1.1  christos values have a permitted maximum value of one week.
    566      1.1  christos 
    567      1.1  christos .. _troubleshooting_nsec3:
    568      1.1  christos 
    569      1.1  christos NSEC3 Troubleshooting
    570      1.1  christos ~~~~~~~~~~~~~~~~~~~~~
    571      1.1  christos 
    572  1.1.1.3  christos BIND includes a tool called :iscman:`nsec3hash` that runs through the same
    573      1.1  christos steps as a validating resolver, to generate the correct hashed name
    574      1.1  christos based on NSEC3PARAM parameters. The command takes the following
    575      1.1  christos parameters in order: salt, algorithm, iterations, and domain. For
    576      1.1  christos example, if the salt is 1234567890ABCDEF, hash algorithm is 1, and
    577      1.1  christos iteration is 10, to get the NSEC3-hashed name for ``www.example.com`` we
    578      1.1  christos would execute a command like this:
    579      1.1  christos 
    580      1.1  christos ::
    581      1.1  christos 
    582      1.1  christos    $ nsec3hash 1234567890ABCEDF 1 10 www.example.com
    583      1.1  christos    RN7I9ME6E1I6BDKIP91B9TCE4FHJ7LKF (salt=1234567890ABCEDF, hash=1, iterations=10)
    584      1.1  christos 
    585  1.1.1.2  christos Zero-length salt can be specified as ``-``.
    586  1.1.1.2  christos 
    587      1.1  christos While it is unlikely you would construct a rainbow table of your own
    588      1.1  christos zone data, this tool may be useful when troubleshooting NSEC3 problems.
    589