Let's Encrypt cannot find the _acme-challenge TXT record for your domain
DNS problem: NXDOMAIN looking up TXT for _acme-challenge.mydomain.clickShort 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.
Fix it fast
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.com2Match what you see, then jump to its fix
- 1
dig returns nothing, while the DNS panel shows a recordThe TXT record is at the wrong name or in the wrong zoneFix - 2
The record appears in the panel and in dig a few minutes laterYou pressed Enter before DNS had published the recordFix - 3
Several _acme-challenge records exist, or the name is a CNAME to another zoneOld TXT values or a delegated name are in the wayFix
- 1
What does the error look like?
DNS problem: NXDOMAIN looking up TXT for _acme-challenge.mydomain.clickThe 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.com2Fix
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.comConfirmed by letsencrypt.org
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.com3Verify
Certbot reports success.
sudo certbot certificatesConfirmed by letsencrypt.org
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.com2Fix
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 zone3Verify
Run the request again.
dig +short TXT _acme-challenge.example.comConfirmed by letsencrypt.org
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 container cannot resolve hostnames (pip, apt, curl fail)
[Errno -3] Temporary failure in name resolution
A container copies its DNS settings from the host.
3 causes, each with a fixServers
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 fixServers
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 fixServers
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 fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fix