DNSSEC

Updated at:

What is DNSSEC

Domain Name System Security Extensions (DNSSEC) uses digital signatures to ensure the authenticity and integrity of DNS responses. Enabling DNSSEC helps prevent attacks such as DNS spoofing and cache pollution and prevents users from being redirected to unintended addresses.

Limitations

Before you enable and use DNSSEC, make sure that you understand the following prerequisites, feature limits, and change requirements:

Prerequisites

  • Edition requirement: DNSSEC is available only to users of Alibaba Cloud DNS paid editions (all paid editions are supported).

  • Service provider support: DNSSEC takes effect only when both the DNS service provider and the domain name registrar support it. Both Alibaba Cloud DNS and the Alibaba Cloud Domain support this service.

  • Recursive DNS validation support: Enabling DNSSEC only on the authoritative DNS does not automatically prevent cache pollution or hijacking. DNSSEC works through a collaborative mechanism of authoritative and recursive DNS:

    • Alibaba Cloud DNS (authoritative) digitally signs the DNS records of the domain name.

    • The recursive DNS used by the user (ISP DNS or public DNS) verifies the signatures and blocks forged responses.

    If the recursive DNS does not support DNSSEC validation, polluted or hijacked responses are still accepted even when the authoritative zone is signed. In this case, DNSSEC provides no protection.

Important

DNSSEC takes effect end-to-end only when all three conditions are met: (1) The authoritative DNS has signed the zone. (2) The registry has published the DS record. (3) The recursive DNS used by the user supports and performs DNSSEC validation.

Feature limits

  • You cannot enable DNSSEC for a subdomain that is hosted independently.

  • You cannot enable DNSSEC if Secondary DNS is enabled for the domain.

  • You cannot enable DNSSEC for a domain name that has ALIAS records.

Change requirements

If DNSSEC is enabled for a domain name, before you perform any of the following operations, you must first delete the DS record at the domain name registrar, wait until it fully expires, and then disable DNSSEC in Alibaba Cloud DNS. Reversing this order or disabling in the DNS console directly causes resolution failures worldwide:

  • Expiration of a paid DNS edition: when you plan not to renew your paid DNS edition.

  • Transfer of a domain name between accounts: when you transfer a domain name from account A to account B.

  • Transfer of DNS resolution across accounts: when you transfer the DNS resolution of a domain name from account A to account B.

  • Detaching a domain name: when you detach a domain name in the console or change the NS servers of the domain name.

Enable DNSSEC

  1. Log on to the Alibaba Cloud DNS - Public Zone page, find the domain name for which you want to enable DNSSEC, and click More > DNSSEC Settings.

  2. On the DNSSEC Settings page, enable DNSSEC.

  3. Copy the DS record information, including Key Tag, Algorithm, Digest Type, and Digest, and then add a DS record at your domain name registrar.

  4. For a domain name registered with Alibaba Cloud, see Configure DNSSEC.

Verify that DNSSEC is in effect

Method 1: Use a web-based tool

Use the testing tool to check your configuration.

Check whether DNSSEC is enabled

For dns-example.com, if no DS record is shown in the highlighted area, DNSSEC is not enabled.

DNSSEC not enabled

DNSSEC is in effect

If the test page shows a DS record at every level of the chain and no red error boxes appear, the DS record is published and DNSSEC is in effect.

DNSSEC in effect

DNSSEC is not in effect

If red error boxes appear on the test page, DNSSEC is not in effect. You can submit a ticket to troubleshoot.

Validation error

Method 2: Use the command line

The following examples use dns-example.com as the example domain name. Replace it with your own domain name. The sample outputs only illustrate the format of the fields. The actual Key Tag, signature values, and TTL depend on your query results.

Read before you verify

  • Do not use Alibaba Cloud Public DNS (223.5.5.5 or 223.6.6.6) for verification: for domain names that have DNSSEC enabled, these two addresses do not return the ad flag or RRSIG records, which leads you to misjudge DNSSEC as not in effect.

    • Correct approach: use a public recursive DNS that supports DNSSEC validation, such as 8.8.8.8, to check the ad flag, or query the authoritative DNS directly.

  • Do not use nslookup for verification: nslookup cannot set the DO bit, cannot request RRSIG records, and does not display the ad flag. Some versions also display DS/DNSKEY records as rdata_43/rdata_48. It can only help check whether records exist. It cannot prove that validation has succeeded.

    • Correct approach: use dig (BIND 9 or later, which is usually preinstalled on Linux and macOS. On Windows, you must install the BIND tools yourself).

Verify in three steps

Step 1: Confirm that the Alibaba Cloud DNS has signed the zone
  1. Obtain the authoritative NS addresses of your domain name:

    dig +short NS dns-example.com
  2. Query the DNSKEY records and signatures directly from the authoritative DNS. Replace <authoritative-NS> with an address obtained in the previous step:

    dig +dnssec DNSKEY dns-example.com @<authoritative-NS>
    dig +dnssec A dns-example.com @<authoritative-NS>
  3. If the zone is signed, the following results are returned (both conditions must be met):

    • DNSKEY query: the flags in the response header contain aa (authoritative answer), the ANSWER section contains DNSKEY records (257 indicates the KSK and 256 indicates the ZSK), and an RRSIG DNSKEY record is also returned.

    • A record query: the ANSWER section returns an RRSIG A record in addition to the A record.

    ;; flags: qr aa rd; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
    dns-example.com.  3600  IN  DNSKEY  257 3 <algorithm> <KSK-public-key...>
    dns-example.com.  3600  IN  DNSKEY  256 3 <algorithm> <ZSK-public-key...>
    dns-example.com.  3600  IN  RRSIG   DNSKEY <algorithm> 2 3600 <expiration> <inception> <KeyTag> dns-example.com. <signature...>
  4. If the zone is not signed, the following results are returned:

    • The DNSKEY query returns status: NOERROR but ANSWER: 0.

    • The A query returns no RRSIG records.

    Go back to the DNS console and check the DNSSEC switch. If you have just enabled DNSSEC, wait for it to take effect and try again.

Step 2: Confirm that the registry has published the DS record
Important

After you submit the DS record at the registrar, the registrar must sync it to the top-level domain (TLD) registry, and the registry must publish it to the Internet. This process involves a delay and is the most common reason why DNSSEC is enabled in the console but validation fails.

  1. Query the DS record through a public recursive DNS:

    dig +short DS dns-example.com @8.8.8.8
  2. (Optional) To rule out the effect of recursive caches, query the TLD authoritative name servers directly:

    # Obtain the TLD authoritative name servers (.com is used as an example; replace it with your TLD)
    dig +short NS com @8.8.8.8
    
    # Query the DS record directly from any of these name servers
    dig +short DS dns-example.com @<TLD-authoritative-NS>
  3. If the DS record is published, the query returns one line with four values: Key Tag, Algorithm, Digest Type, and Digest:

    2371 13 2 32996839A6D808AFE3EB4A795A0E6A7A39A76FC52FF228B22B76F6D6...

    These four values must exactly match the Key Tag, Algorithm, Digest Type, and Digest shown on the DNSSEC Settings page of the Alibaba Cloud DNS console. If they do not match, the DS record entered at the registrar is incorrect, for example because it was copied incompletely or the wrong Digest Type was selected. Correct it and wait for it to be published again.

  4. If the DS record is not published, the query returns nothing. If you are sure that you have submitted it at the registrar, contact the registrar to confirm whether it has been submitted to the registry.

Step 3: Confirm that end-to-end validation succeeds
  1. After the previous two steps both pass, use a recursive DNS that supports DNSSEC validation for the final check:

    dig +dnssec A dns-example.com @8.8.8.8
  2. If DNSSEC is in effect, the flags in the response header contain ad (Authenticated Data, which indicates that DNSSEC validation has succeeded), and the ANSWER section contains RRSIG records:

    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12345
    ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1
  3. If DNSSEC is not in effect, the flags are qr rd ra (no ad), and the ANSWER section contains no RRSIG records. Use the following table to locate the problem.

Interpret the results and take action

Step 1:

Authoritative DNSKEY/RRSIG

Step 2:

Registry DS

Step 3:

Recursive ad

Conclusion and action

No

No

No

The authoritative zone is not signed. Check the DNSSEC switch in the console. Make sure that the domain name does not use subdomain independent DNS hosting, secondary DNS, or ALIAS records.

Yes

No

No

The zone is signed, but the DS record has not been published to the registry. Add or check the DS record at the registrar, and confirm that the registrar has submitted it to the registry.

Yes

Yes (different from the console values)

No

The DS record is incorrect. Correct it exactly based on the four values shown in the console and wait for it to be published again.

Yes

Yes (matches the console values)

No

The chain of trust is complete. In most cases, the recursive cache has not expired yet. Wait until the TTL of the original DS/DNSKEY records expires and try again, or check with another validating recursive DNS.

Yes

Yes

Yes

DNSSEC is in effect.

No

Yes

No (returns SERVFAIL)

High-risk state (your services may already be interrupted): the DS record still exists at the registry, but the authoritative zone has no signatures, so recursive validation fails and resolvers refuse to return results. See "Troubleshooting" below.

Disable DNSSEC

You must disable DNSSEC strictly in the following order: delete the DS record, confirm that the DS record has disappeared from the registry, and then turn off the switch in the DNS console. If you reverse this order (the authoritative signatures are gone but the DS record still exists at the registry), the domain name fails to resolve on all recursive DNS services that support DNSSEC validation.

Step 1: Delete the DS record at the domain name registrar

The following example uses a domain name registered with Alibaba Cloud. For other registrars, contact the corresponding provider.

  1. Log on to the Domain Names Console.

  2. On the Domain Names page, find the domain name and click Manage in the Actions column.

  3. In the left navigation pane, click DNSSEC Settings under DNS Management, and then click Delete next to the DS record.

Step 2: Confirm that the registry has deleted the DS record

The registrar's interface showing "deleted" does not mean the change has taken effect on the Internet. From clicking Delete to global expiration, the DS record goes through three stages. Make sure that you understand the delay mechanism:

Stage

Description

How to confirm

(1) Registrar submits to registry

After accepting the deletion, the registrar syncs it to the registry (not in real time).

Contact the registrar to confirm that it has been submitted.

(2) Registry publishes the update

The registry updates the parent zone data.

Query the TLD authoritative name servers directly. See the commands below.

(3) Global recursive caches expire

Public DNS services in various regions still cache the old DS record until the TTL expires.

Cannot be accelerated. You can only wait.

  1. Run the following commands to query the TLD authoritative name servers directly and confirm that the DS query returns nothing. If a DS record is still returned, wait patiently and try again.

    # Obtain the TLD authoritative name servers (.com is used as an example; replace it with your TLD)
    dig +short NS com @8.8.8.8
    
    # Query the TLD authoritative name server directly: an empty result means the registry no longer has the DS record
    dig +short DS dns-example.com @<TLD-authoritative-NS>
  2. (Optional) For cryptographic confirmation of the deletion, add the +dnssec parameter:

    dig +dnssec DS dns-example.com @<TLD-authoritative-NS>

    If the response returns ANSWER: 0 and the AUTHORITY section contains NSEC3 records and their RRSIG, the registry has issued a signed proof that no DS record exists for the domain name. This confirms that the deletion succeeded.

  3. Estimate the wait time in stage (3) by querying the TTL:

    The TTL of DS records is set by the corresponding registry and varies by TLD. For example, measured for .com, the DS record TTL is 86400 seconds (24 hours), and the negative response caching time when no DS record exists is 900 seconds (15 minutes). The measured negative response caching time for .cn is 21600 seconds (6 hours). Run the following command to check the actual TTL for the TLD of your domain name:

    dig DS dns-example.com @<TLD-authoritative-NS>     # Check the TTL in the second column of the DS record

Step 3: Disable DNSSEC in Alibaba Cloud DNS

  1. On the Alibaba Cloud DNS - Public Zone page, find the domain name for which you want to disable DNSSEC, and click More > DNSSEC Settings.

  2. On the DNSSEC Settings page, disable DNSSEC.

Troubleshooting

When a domain name that has or previously had DNSSEC enabled fails to resolve (returns SERVFAIL), the cause is usually a reversed disabling order or a triggered change restriction. For example, DNSSEC was disabled in Alibaba Cloud DNS first, the paid edition expired and was released, the domain name was transferred across accounts, or the domain name was detached. In these cases, the authoritative zone no longer has signatures, but the DS record still exists at the registry, which causes validation to fail on recursive servers.

Follow these steps for emergency diagnosis and service recovery:

Step 1: Use the +cd parameter to quickly isolate the fault

When resolution returns SERVFAIL, you can use the +cd (Checking Disabled, which asks the recursive server to skip DNSSEC validation) parameter of dig to quickly determine whether the failure is caused by DNSSEC:

dig A dns-example.com @8.8.8.8          # Regular query
dig +cd A dns-example.com @8.8.8.8      # Skip DNSSEC validation

Regular query

+cd query

Description

SERVFAIL

NOERROR (records returned)

Confirmed as a DNSSEC validation failure. The DNS records themselves are normal. Continue to the next step for further diagnosis.

SERVFAIL

SERVFAIL

Not related to DNSSEC. The problem lies in the resolution path or record configuration. Troubleshoot it as a regular resolution failure.

NOERROR

NOERROR

This recursive DNS does not perform DNSSEC validation for this domain name, or DNSSEC is not enabled for the domain name. Make sure that you use a validating recursive DNS.

Warning

The +cd parameter disables security validation. Use it only to locate the fault. Do not use it as a long-term solution for your services.

Step 2: Check the authoritative signatures and DS status

If Step 1 confirms a DNSSEC failure, run the following two commands to check the status on both sides. Replace <authoritative-NS> with the actual authoritative address:

# (1) Check whether the authoritative zone still has signatures
dig +dnssec DNSKEY dns-example.com @<authoritative-NS>

# (2) Check whether the registry still has the DS record
dig +short DS dns-example.com @8.8.8.8

Typical failure symptoms

If the following conditions are met, the failure is confirmed as "authoritative signatures lost but the DS record remains":

  • Command (1) (DNSKEY): returns ANSWER: 0, with no DNSKEY or RRSIG records.

  • Command (2) (DS): still returns the four values (Key Tag, Algorithm, Digest Type, and Digest).

Step 3: Service recovery options

After the failure is confirmed, you can choose either of the following recovery paths based on the urgency of your services:

  • Option A: Delete the DS record from the registry (standard permanent recovery)

    1. Delete the DS record of the domain name at your domain name registrar. For a domain name registered with Alibaba Cloud, see Disable DNSSEC. For other registrars, contact the corresponding provider.

    2. Follow the method in "Confirm that the registry has deleted the DS record" above to query the TLD authoritative name servers directly and confirm that the DS record has completely disappeared.

    3. Wait for global caches to expire: after the deletion, global recovery may take up to 24 hours, depending on the TLD TTL. During this period, because public DNS nodes in different regions expire their caches at different times, resolution may intermittently succeed or fail (normal in some regions while SERVFAIL is still returned in others). This is normal. Wait patiently for the caches to expire naturally.

    4. Confirm the final recovery: when dig +short DS dns-example.com @<TLD-authoritative-NS> returns nothing and the regular query dig A dns-example.com @8.8.8.8 returns NOERROR with normal records, the failure is completely resolved. At this point, the domain name resolves normally without DNSSEC protection.

  • Option B: Re-enable the DNSSEC switch in Alibaba Cloud DNS (emergency temporary recovery)

    If your services are interrupted and you cannot wait for the DS deletion to take effect, you can try to re-enable the DNSSEC switch in the Alibaba Cloud DNS console so that the authoritative signatures are restored and match the DS record that still exists at the registry.

    Important

    This path works only when the KSK generated after DNSSEC is re-enabled exactly matches the DS record that still exists at the registry (all four values are identical). If the keys have been rotated after re-enabling and no longer match, resolution still fails. After you re-enable DNSSEC, be sure to verify whether it is in effect by using the methods described above.

FAQ

Do yellow warnings in DNSSEC validation affect DNSSEC?

image

Yellow warnings do not affect DNSSEC for your domain name. Alibaba Cloud authoritative DNS uses intelligent resolution, so it is normal for the IP address returned by the authoritative DNS to differ from the authenticated glue address record.

After DNSSEC is enabled for a domain name, why does DNSSEC validation succeed for A records but fail for CNAME records?

DNSSEC validates through a chain of trust, and every link in the chain must support DNSSEC. For CNAME records, DNSSEC must also be enabled for the CNAME target domain name. If DNSSEC is enabled only for the primary domain name but not for the CNAME target domain name, DNSSEC validation cannot succeed.