{"id":2615,"date":"2019-10-22T17:26:21","date_gmt":"2019-10-22T09:26:21","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&p=2615"},"modified":"2022-10-05T08:02:44","modified_gmt":"2022-10-05T00:02:44","slug":"troubleshooting-dnssec","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/troubleshooting-dnssec","title":{"rendered":"Troubleshooting DNSSEC"},"content":{"rendered":"\t\t
Dig<\/em>\u00a0is a command-line tool to query a nameserver for DNS records. For instance,\u00a0dig\u00a0<\/em>can ask a DNS resolver for the IP address of\u00a0www.cloudflare.com\u00a0<\/em>(The option\u00a0+short<\/em>\u00a0outputs the result only):<\/em><\/p> Use\u00a0dig<\/em>\u00a0to verify DNSSEC records. \u00a0In the example below, the last line of output is the\u00a0RRSIG\u00a0record<\/em>. \u00a0RRSIG<\/em> is the DNSSEC signature attach to the record. With the RRSIG<\/em>, a DNS resolver determines whether a DNS response is trust.<\/span><\/p> Dig<\/em> also retrieves the public key use to verify the DNS record. \u00a0A domain’s DNS records are all signed with the same public key. Therefore,<\/span>\u00a0query for the root domain’s public key, not the subdomain’s public key:<\/p> The DNS response includes two records:<\/p> Details on how to verify the signatures with the public key are beyond the scope of this article.<\/p> When not using the\u00a0+short<\/em>\u00a0option with\u00a0dig<\/em>, a DNS response is DNSSEC authenticated if the\u00a0ad<\/strong>\u00a0flag appears in the response header:<\/p> Full verification of domain signatures (for example:\u00a0cloudflare.com<\/em>) involves verifying the key-signing key at the top-level-domain (for example:\u00a0.com<\/em>). \u00a0Similar verification is\u00a0then performed by checking the key-signing\u00a0<\/span>key of\u00a0.com<\/em>\u00a0at the root server level. DNSSEC root keys are distributed to DNS clients to complete the trust chain.<\/span><\/p> When DNSSEC is enabled, a\u00a0DS record<\/em>\u00a0is required at the registrar’s DNS. The\u00a0DS record<\/em>\u00a0contains a hash of the public key-signing key as well as metadata about the key.<\/p> Use\u00a0dig<\/em>\u00a0to find a\u00a0DS record<\/em>:<\/p> When using the\u00a0<\/span>+trace\u00a0<\/span><\/em>option<\/span>,<\/span>\u00a0dig<\/em>\u00a0confirms whether an answer is\u00a0returned by the nameserver for\u00a0<\/span>cloudflare.com<\/em>\u00a0<\/span>or the nameserver for\u00a0.com<\/em>. \u00a0In this example, the\u00a0DS record<\/em>\u00a0for\u00a0cloudflare.com<\/em> is return by e.gtld-servers.net:<\/span><\/p> An easy alternative to manually running all the steps above is to use the DNSViz online tool. See further details on troubleshooting DNSSEC Validation using DNSViz or an example of DNSSEC results of cloudflare.com via DNSViz.<\/p> Issues occur if authoritative DNS providers are changed without updating or removing old DNSSEC records at the registrar:<\/p> Confirm whether a\u00a0SERVFAIL<\/em>\u00a0response is related to DNSSEC by running\u00a0dig<\/em>\u00a0with the\u00a0+cd<\/em>\u00a0option. The\u00a0+cd<\/em>\u00a0option provides DNS results without any DNSSEC validation in place.<\/p> In the above example, DNSSEC is misconfigure if a proper DNS response is receive when using the +cd<\/em>\u00a0option but queries using DNSSEC return a\u00a0SERVFAIL<\/em>\u00a0response.<\/em> This issue often happens when authoritative nameservers are change but\u00a0DS records<\/em> are not update. \u00a0The issue can also occur if an attacker attempts to forge a response to a query.<\/p> Below is an example of a working domain without DNSSEC as diagrammed by dnsviz.net:<\/p> Below is an example of a domain with functioning DNSSEC records between the TLD nameservers and the authoritative nameservers for cloudflare.com:<\/p> Below is an example of how dnsviz.net. It will display incorrect delegation when no valid DNSKEY records are provide by the authoritative nameserver. To match the DS record published by the TLD nameserver:<\/p> If a problem is discover with DNSSEC implementation, contact the domain’s registrar and confirm the DS record<\/em> matches what the authoritative DNS provider has specify. If Cloudflare is the authoritative DNS provider, follow the instructions for configuring DNSSEC with Cloudflare.<\/p><\/div>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":" Troubleshooting DNSSEC Testing DNSSEC with Dig Dig\u00a0is a command-line tool to query a nameserver for DNS records. For instance,\u00a0dig\u00a0can ask a DNS resolver for the IP address of\u00a0www.cloudflare.com\u00a0(The option\u00a0+short\u00a0outputs the result only): $\u00a0dig www.cloudflare.com +short 198.41.215.162 198.41.214.162 Use\u00a0dig\u00a0to verify DNSSEC records. \u00a0In the example below, the last line of output is the\u00a0RRSIG\u00a0record. \u00a0RRSIG is the …<\/p>\n$\u00a0dig www.cloudflare.com +short 198.41.215.162 198.41.214.162<\/pre>
$\u00a0dig www.cloudflare.com +dnssec +short 198.41.214.162 198.41.215.162 A 13 3 300 20180927180434 20180925160434 35273 cloudflare.com. DYYZ\/bhHSAIlpvu\/HEUsxlzkC9NsswbCQ7dcfcuiNBrbhYV7k3AI8t46 QMnOlfhwT6jqsfN7ePV6Fwpym3B0pg==<\/pre>
$\u00a0dig\u00a0DNSKEY cloudflare.com +short 257 3 13 mdsswUyr3DPW132mOi8V9xESWE8jTo0dxCjjnopKl+GqJxpVXckHAeF+ KkxLbxILfDLUT0rAK9iUzy1L53eKGQ== 256 3 13 koPbw9wmYZ7ggcjnQ6ayHyhHaDNMYELKTqT+qRGrZpWSccr\/lBcrm10Z\u00a01PuQHB3Azhii+sb0PYFkH1ruxLhe5g==<\/pre>
$\u00a0dig\u00a0www.cloudflare.com [...] ;; ->>HEADER<<- opcode: QUERY, status: NOERROR,\u00a0id: 65326\n;; flags: qr rd ra ad; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1 [...] ;; QUESTION SECTION: ;www.cloudflare.com.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 IN\u00a0 A [...] ;; ANSWER SECTION: www.cloudflare.com. 15\u00a0 IN\u00a0 A\u00a0\u00a0 198.41.215.162 www.cloudflare.com. 15\u00a0 IN\u00a0 A\u00a0\u00a0 198.41.214.162<\/pre>
Viewing the DNSSEC Chain of Trust with Dig<\/strong><\/h3>
$\u00a0dig\u00a0+short DS cloudflare.com 2371 13 2 32996839A6D808AFE3EB4A795A0E6A7A39A76FC52FF228B22B76F6D6 3826F2B9<\/pre>
$ dig\u00a0DS cloudflare.com +trace [...] cloudflare.com.\u00a0\u00a0\u00a0\u00a0 86400\u00a0\u00a0 IN\u00a0 DS\u00a0 2371 13 2 32996839A6D808AFE3EB4A795A0E6A7A39A76FC52FF228B22B76F6D6 3826F2B9 [...] com.\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 172800\u00a0 IN\u00a0 NS\u00a0 e.gtld-servers.net. [...] ;; Received 1213 bytes from 2001:502:1ca1::30#53(e.gtld-servers.net) in 37 ms<\/pre>
Troubleshooting DNSSEC Validation with Dig<\/strong><\/h3>
$\u00a0dig\u00a0A brokendnssec.net @1.0.0.1 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0 ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL,\u00a0id: 10663<\/pre>
$ dig\u00a0A brokendnssec.net @1.0.0.1 +dnssec +cd\u00a0+short 104.20.49.61 104.20.48.61<\/pre>
Troubleshooting DNSSEC Validation using DNSViz<\/strong><\/h3>
Example without DNSSEC<\/strong><\/h4>
\u00a0<\/span><\/p>Example with correct DNSSEC<\/strong><\/h4>
<\/span><\/p>Example with missing or incorrect RRSIG record on authoritative nameserver<\/strong><\/h4>
<\/span><\/p>Next steps<\/strong><\/h3>