How can I identify and troubleshoot DNSSEC configuration issues in Route 53?

5 minute read
0

DNS resolution for resolvers that support DNSSEC (for example, 8.8.8.8 or 1.1.1.1) returns SERVFAIL responses in Amazon Route 53 because of DNSSEC misconfiguration.

Resolution

Step 1: Confirm that DNSSEC configuration is causing the DNS resolution failure

1.    Run the dig command to force the query through the Google DNS resolver, 8.8.8.8. Google DNS resolver supports DNSSEC and returns a SERVFAIL response if DNSSEC is misconfigured. In the following example command, replace dnssec.example.live with your domain.

$ dig dnssec.example.live @8.8.8.8

The output from the previous commands shows a SERVFAIL response:

;  <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2  <<>> dnssec.example.live @8.8.8.8
;; global options: +cmd
;; Got answer:
;; -->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 30778
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;dnssec.example.live.    IN    A

;; Query time: 24 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Apr 21 18:13:57 UTC 2022
;; MSG SIZE  rcvd: 52

2.    Run the dig command again, and set the cd flag. The cd flag, resolves the query without checking for DNSSEC. In the following example command, replace dnssec.example.live with your domain.

$ dig dnssec.example.live @8.8.8.8 +cd

The following output example confirms that DNSSEC misconfiguration caused the SERVFAIL response:

; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2 <<>> dnssec.example.live @8.8.8.8 +cd

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30235
;; flags: qr rd ra cd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;dnssec.example.live.    IN    A

;; ANSWER SECTION:
dnssec.example.live. 300    IN    A    10.10.10.10

;; Query time: 28 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Thu Apr 21 18:15:51 UTC 2022
;; MSG SIZE  rcvd: 68

Step 2: Identify the DS record created on the parent zone

Note: The registrar adds the DS record for the TLD. So, the parent zone for the domain 'example.com' is the '.com' zone. In this example, the parent zone for 'dnssec.example.live' is 'example.live'.

1.    Run the dig +trace command to view the complete delegation and name servers for the parent zone:

dig +trace dnssec.example.live

>>truncated for convenience

example.live.    3600    IN    NS    ns-xxx.awsdns-xx.net.
example.live.    3600    IN    NS    ns-xxxx.awsdns-xx.org.
example.live.    3600    IN    NS    ns-xxxx.awsdns-xx.co.uk.
example.live.    3600    IN    NS    ns-xxx.awsdns-xx.com.
example.live.    3600    IN    DS    28927 13 2 133329D78FFCD003D39BAB9386FC18A49807584CD42042B3F53E1293 8F63C5A7
example.live.    3600    IN    RRSIG    DS 8 2 3600 20220508154435 20220417144435 32325 live. HzdzyWb8+8G1vbzMWR/7usqN5GihWpuToRKnWv3NSXPnzzYaAFrkuYlU pX8izzvnXk/uyiCOcMShQPKfybgviNkm+yfyTwm3rOso8amJDz0Jz8ml lz7jhgH0k04gLbbT7i8Ez8k8qPLB9MVb1jtVz7rjl6k4Y4m38aHUMy0D lxk=
;; Received 404 bytes from 65.22.22.1#53(v0n2.nic.live) in 1 ms

dnssec.example.live. 10    IN    NS    ns-xxxx.awsdns-xx.org.
dnssec.example.live. 10    IN    NS    ns-xxx.awsdns-xx.com.
dnssec.example.live. 10    IN    NS    ns-xxxx.awsdns-xx.co.uk.
dnssec.example.live. 10    IN    NS    ns-xxx.awsdns-xx.net.
dnssec.example.live. 300    IN    DS    41670 13 2 DE085966266F92FA81BBE2829AD9CD8C2C7FC8109D748F49B5A99D2F A1893581
dnssec.example.live. 300    IN    RRSIG    DS 13 3 300 20220421192820 20220421172320 53547 example.live. xdwGnGasWO2sbZQoAfYdZK2bAMcpYOjMR+mg2ilt00XDIwrPc/Qac1k2 Lc2NpAcFpgb3KbhzFxpd3Z7qXjPsvw==
;; Received 352 bytes from 205.251.197.102#53(ns-xxxx.awsdns-xx.org) in 6 ms

dnssec.example.live. 300    IN    A    1.1.1.1
dnssec.example.live. 300    IN    RRSIG    A 13 3 300 20220421192821 20220421172321 51615 dnssec.example.live. sMzXesnw+7pSHK2Mlkossyjml8sK7RhgKyu50J/P3/TEeChPzia8EfDb nbv3fFDxXQcbqPH+M+6KlQ7JrAmBig==
;; Received 187 bytes from 205.251.192.150#53(ns-xxx.awsdns-xx.com) in 14 ms

2.    To check the DS record at the parent zone, run the following query through the name servers of the parent zone (in this example, example.live):

`$ dig DS dnssec.example.live @ns-xxx.awsdns-xx.net. +short `
41670 13 2 DE085966266F92FA81BBE2829AD9CD8C2C7FC8109D748F49B5A99D2F A1893581

Configure the DS record at the parent zone. Then, check the DS record against the hashed value of the public KSK of the child zone to confirm that the DS record is accurate.

Step 3: Confirm that DNSSEC signing is turned on for the hosted zone

Run the following command to confirm that DNSSEC signing is turned on for the hosted zone:

$ dig DNSKEY dnssec.example.live @ns-xxxx.awsdns-xx.org +noall +answer +multiline

The following output confirms that DNSSEC signing is turned on and lists the public keys present in the zone. 

`; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.amzn2.5.2 <<>> DNSKEY dnssec.example.live @ns-xxxx.awsdns-xx.org +noall +answer +multiline`  
`;; global options: +cmd`  
`dnssec.example.live. 3600 IN DNSKEY    256 3 13 (`  
`                4xMqBH+v21Ria6T00Oq08fY8S3FxA9XFp34uDQm0dBpk`  
`                l6MwBNLZxpwpzS35yunxEYKwHkoPnMtu1bckRFauJg==`  
`                ) ; ZSK; alg = ECDSAP256SHA256 ; key id = 51615`  
`dnssec.example.live. 3600 IN DNSKEY    257 3 13 (`  
`                pvoQ+Q2TvJKRuxdv8yuJhLkJhdrYUf/ZA2REWUTAXsfS`  
`                laK0MFDzCurSXXjlQxQoVGauDe5CwGufXl40fVzt/w==`  
`                ) ; KSK; alg = ECDSAP256SHA256 ; key id = 41670`

If the command doesn't yield a response, then DNSSEC signing isn't turned on in the hosted zone. If DNSSEC isn't turned on, then remove the DS record from the registrar.

Step 4: Identify what the correct DS record created on the parent zone

1.    Run the following command to install bind and bind-ultis:

$ sudo yum install bind bind-utils -y

2.    Run the following command to get the correct DS record that's created on the parent zone:

$ dig DNSKEY dnssec.example.live @ns-xxxx.awsdns-xx.org. | dnssec-dsfromkey -2 -f - dnssec.example.live

dnssec.example.live. IN DS 41670 13 2 DE085966266F92FA81BBE2829AD9CD8C2C7FC8109D748F49B5A99D2FA1893580

Step 5: Match the DS record obtained in step 4 with the DS record obtained in step 2

Make sure that the DS record created on the parent zone matches the DS record that you got in step 4.

From step 2:

41670 13 2 DE085966266F92FA81BBE2829AD9CD8C2C7FC8109D748F49B5A99D2F A1893581 << Incorrect string

From step 4:

41670 13 2 DE085966266F92FA81BBE2829AD9CD8C2C7FC8109D748F49B5A99D2FA1893580

In the preceding example, the hash value of the DS record that's configured at the parent zone (from step 2) is incorrect. This mismatch causes DNS resolution issues.

To resolve the issue, create the correct DS record value at the registrar end (parent zone). For domains registered with Route 53, use the get-dnssec command to get the correct information to add public keys for your domain.

Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent version of the AWS CLI.

$ aws --region us-east-1 route53 get-dnssec --hosted-zone-id $hostedzone_id
AWS OFFICIAL
AWS OFFICIALUpdated a year ago