Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Let's Encrypt cannot find the _acme-challenge TXT record for your domain

ErrorDNS problem: NXDOMAIN looking up TXT for _acme-challenge.mydomain.click

Short answer

With the DNS-01 challenge, Let's Encrypt looks up a TXT record named _acme-challenge under your domain. NXDOMAIN or no TXT means that lookup found nothing. Make sure the record sits at the right name in the zone that answers for the domain, wait for the DNS provider to publish it, and remove old values.

  • Applies to Certbot 4.x, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask public DNS for the exact record Let's Encrypt asks for. If it is empty here, the problem is the record, not Certbot.

    dig +short TXT _acme-challenge.example.com
    dig +short NS example.com
  2. 2Match what you see, then jump to its fix

    1. 1dig returns nothing, while the DNS panel shows a recordThe TXT record is at the wrong name or in the wrong zoneFix
    2. 2The record appears in the panel and in dig a few minutes laterYou pressed Enter before DNS had published the recordFix
    3. 3Several _acme-challenge records exist, or the name is a CNAME to another zoneOld TXT values or a delegated name are in the wayFix

What does the error look like?

  • DNS problem: NXDOMAIN looking up TXT for _acme-challenge.mydomain.click
  • The TXT record added at the DNS host never shows up for validation

Cause 1 of 3

The TXT record is at the wrong name or in the wrong zone

1Check

The client creates a TXT record at _acme-challenge.<your domain>. Also confirm the zone you edit is the one the domain's NS records point to.

dig +short NS example.com
dig +short TXT _acme-challenge.example.com

2Fix

Create the record at exactly that name, in the zone that your NS records name.

# DNS panel
Type: TXT   Host: _acme-challenge   Value: <value Certbot printed>

3Verify

dig shows the value Certbot printed.

dig +short TXT _acme-challenge.example.com

Confirmed by letsencrypt.org

Did this fix it?

Cause 2 of 3

You pressed Enter before DNS had published the record

1Check

DNS providers have a propagation time. Let's Encrypt says that without an API that reports completion, you may need to wait often as much as an hour before validation.

dig +short TXT _acme-challenge.example.com @$(dig +short NS example.com | head -n1)

2Fix

Wait until dig against your own authoritative name server shows the value, then let Certbot continue. For automation, use a DNS plugin that waits for propagation.

# do not continue the Certbot prompt until this prints the value
dig +short TXT _acme-challenge.example.com

3Verify

Certbot reports success.

sudo certbot certificates

Confirmed by letsencrypt.org

Did this fix it?

Cause 3 of 3

Old TXT values or a delegated name are in the way

1Check

Several TXT values may share the name (for example wildcard plus bare domain), but Let's Encrypt says to clean old ones up, since oversized responses are rejected. CNAME or NS records can hand the challenge to another zone, and then the record must be created there.

dig +short CNAME _acme-challenge.example.com
dig +short TXT _acme-challenge.example.com

2Fix

Delete stale TXT values. If the name is delegated, create the TXT record in the zone it points to.

# DNS panel: remove old _acme-challenge TXT values,
# or add the TXT record in the CNAME target zone

3Verify

Run the request again.

dig +short TXT _acme-challenge.example.com

Confirmed by letsencrypt.org

Did this fix it?

How do I stop it coming back?

  • Use a Certbot DNS plugin for your DNS provider instead of adding TXT values by hand.
  • Use narrowly scoped DNS API credentials, as Let's Encrypt advises.
  • Remove old _acme-challenge values after each issue.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

Docker pull or container DNS fails with "server misbehaving"

docker pull fails while a browser on the same machine opens the registry fine

'Server misbehaving' is a Go resolver error: the DNS server answered, but with a reply code that is neither success nor name-not-found.

3 causes, each with a fix

Servers

WSL2 cannot resolve names while a VPN is connected

names do not resolve inside WSL after the VPN connects, but pinging an IP address works

WSL2 gets its DNS settings from Windows through a virtual network, and a VPN client can change what Windows resolves without WSL following.

3 causes, each with a fix

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.