ssl-guides 2026-12-02 ⏱ 4 min read

What Is DNS-01 Validation? A Practical Guide

What Is DNS-01 Validation? A Practical Guide

DNS-01 validation is one of the challenge types in the ACME protocol. Instead of serving a file over HTTP, you publish a TXT record in your domain's DNS zone. The certificate authority looks up that record, and if the value matches, it treats you as the controller of the domain and issues the certificate.

How DNS-01 validation works

  1. Your ACME client asks the CA for a certificate and receives a challenge token.
  2. The client computes a value from the token and your account key.
  3. It creates a TXT record at _acme-challenge.example.com with that value.
  4. It tells the CA to check. The CA queries DNS from several network locations.
  5. When the lookup matches, the client removes the record and downloads the certificate.

If you are new to the protocol, start with our ACME overview.

When you need DNS-01 validation

  • Wildcard certificates. A name like *.example.com can only be validated with DNS-01.
  • Servers with no public web port. Internal hosts and machines behind NAT can still get public certificates.
  • Many hosts, one certificate. You validate once in DNS instead of reaching each server.

The record looks like this

_acme-challenge.example.com.  300  IN  TXT
  "gfj9Xq...Rg85nM"

The value is random and different for every attempt. You can check that it is visible with a lookup:

dig +short TXT _acme-challenge.example.com

You can also use our DNS lookup tool to see records from outside your own network.

Automating DNS-01

Doing this by hand works once, but certificates renew regularly, so you want the client to edit DNS itself. Most clients have plugins or scripts for popular DNS providers. They use an API token that can edit records.

Keep that token narrow. Scope it to one zone if your provider allows it, store it with strict file permissions and never commit it to a repository. A leaked DNS token lets someone change where your domain points, which is worse than a leaked certificate.

A common tidy pattern is to delegate the challenge name to a separate zone with a CNAME, so the client only needs rights over that small zone:

_acme-challenge.example.com.  IN  CNAME
  _acme-challenge.acme-zone.example.net.

For a full walkthrough with a client, read installing a free wildcard certificate with DNS-01.

Common failures

SymptomLikely causeFix
Record not foundPropagation delay or wrong zoneWait, then query the authoritative name servers directly
Wrong value returnedOld TXT record left from an earlier attemptDelete stale records, keep only the new one
Timeout on lookupName servers unreachable or DNSSEC brokenCheck the zone health and DS records
Permission denied from APIToken lacks edit rights on the zoneCreate a token with record-edit permission for that zone

Our guide to fixing DNS validation errors goes through each of these in more detail.

Strengths and limits

  • Strength: works for wildcards and for hosts that are not reachable from the internet.
  • Strength: not affected by redirects, CDNs or firewall rules on the web port.
  • Limit: needs DNS API access, which makes it more sensitive to secure than a plain web challenge.
  • Limit: propagation delays can slow a run when your DNS provider is slow.

A quick example with Certbot

To issue a wildcard certificate with a DNS plugin for Cloudflare, you give Certbot a credentials file and the plugin name. Other providers have their own plugins, so check the plugin documentation for your DNS host.

sudo certbot certonly --dns-cloudflare \
  --dns-cloudflare-credentials /root/cf.ini \
  -d example.com -d "*.example.com"

The wildcard name covers one level only. *.example.com matches blog.example.com but not a.blog.example.com, and the bare domain must be listed separately, as above. Lock the credentials file down with chmod 600 so only root can read it. If you want to restrict which CAs may issue for your domain, add a CAA record as described in our CAA records guide. For wildcard background, see how to get a free wildcard certificate.

If you use a public cloud DNS service, prefer its native token scopes and audit logs. After issuance, confirm the result with a quick check of the certificate expiry and names, which our SSL checker can show.

Key takeaways

  • DNS-01 proves control with a TXT record at _acme-challenge.
  • It is required for wildcard certificates.
  • Automate it with a narrowly scoped API token or a delegated challenge zone.
  • When it fails, query the authoritative name servers first.

Related reading: TLS-ALPN-01 validation and certificate signing requests.

Frequently Asked Questions

Why do wildcards need DNS-01?

Because a wildcard has no single hostname to put in an HTTP challenge. The CA can only check a DNS record that covers the whole zone.

How long should the TXT record stay up?

Until the CA has checked it. Clients usually remove it after issuance, and leaving old values behind is a common cause of a failed next attempt.

Can I delegate DNS-01 to another zone?

Yes. A CNAME from _acme-challenge.yourdomain.com to a name in a zone you control lets the client update only that small zone.

What permissions does the API token need?

Record edit rights for the zone holding the challenge, and nothing else. Scope it to one zone if your provider allows that.

Is DNS-01 slower than HTTP-01?

Often yes, because it waits for DNS propagation. That is the price for working behind a closed port 80 or for wildcards.

🔒 Test Your Website SSL Certificate Now
Run Free SSL Check →

✅ Post-Installation Verification & SEO Checklist

After applying the steps above, run through this 5-point checklist to prevent browser warnings and protect your Google SEO rankings:

  • Verify full CA chain trust and TLS 1.3 support using our Live SSL Checker.
  • Scan for Mixed Content HTTP links and check HSTS/CSP headers on Security Headers Checker.
  • Enforce a permanent 301 HTTP-to-HTTPS redirect with our HTTPS Redirect Generator.
  • Confirm both root and www versions resolve cleanly to one canonical HTTPS URL.
  • Verify your HTTPS property and sitemap.xml inside Google Search Console and Bing Webmaster Tools.
Technically Reviewed by TryFreeSSL Security Team
Last updated: 2026-12-05
About Us →

Free SSL Certificates, Live SSL Checker & CSR Generator

Issue trusted Let's Encrypt SSL certificates in 60 seconds with zero server setup.

Related Articles

🤖 TryFreeSSL AI Assistant