A website opens normally over HTTPS and the browser shows a valid certificate, but automatic renewal through Let’s Encrypt fails during HTTP-01 validation. The administrator checks IPv4: the web server responds, port 80 is accessible and the challenge path works. Yet the ACME client cannot prove control of the domain.
The cause may be an AAAA record left behind after a server migration or pointing to a misconfigured IPv6 address. The existing certificate remains valid until it expires, so a renewal failure may go unnoticed. Start by comparing the DNS records:
dig +short A example.com
dig +short AAAA example.com
If the A record points to the current server but AAAA points elsewhere, find out where IPv6 requests are going and what response they receive during HTTP-01 validation. Successful IPv4 access tells you nothing about IPv6 validation. A browser may still open the site normally because browsers and ACME validators can select different addresses. Test both address families and the exact path requested by the validator.
Why an Incorrect AAAA Record Affects Let’s Encrypt
For HTTP-01 validation, Let’s Encrypt prefers IPv6 for the initial connection when a domain publishes both A and AAAA records. A website on a VPS with public IPv4 and IPv6 may work perfectly over IPv4 while a misconfigured IPv6 service prevents certificate renewal.
An AAAA record does not make Let’s Encrypt use IPv6 for every attempt. If the initial IPv6 connection times out and IPv4 is available, the validator may retry over IPv4. That retry applies specifically to connection timeouts, not every kind of failure. If the IPv6 server accepts the connection and returns 404, another website’s page or an incorrect token, Let’s Encrypt will not retry over IPv4 merely because the HTTP response was wrong.
A common example follows a migration: the A record points to the new server, but AAAA still points to the old one. Port 80 remains open on the old server, although it no longer has the current ACME challenge. The validator receives an HTTP response, but not the expected content. There is no automatic fallback to the working IPv4 address. This behaviour is documented in Let’s Encrypt’s IPv6 support guidance. Other certificate authorities may follow different retry rules.
How HTTP-01 Works and Why Port 80 Matters
The ACME client receives a challenge token and makes the required response available at a URL such as:
http://example.com/.well-known/acme-challenge/TOKEN
Let’s Encrypt retrieves this URL externally and checks the response against the expected value derived from the token and the ACME account. Validation runs again during renewal, so successful initial issuance does not guarantee renewal after DNS settings have changed.
HTTP-01 starts on TCP port 80; an arbitrary port cannot be substituted. Let’s Encrypt follows HTTP and HTTPS redirects to ports 80 and 443, with a maximum of ten redirects. It does not require a trusted certificate at an HTTPS redirect destination. These rules are described in the HTTP-01 documentation.
The homepage can work while /.well-known/acme-challenge/ does not. The ACME client may use a separate directory, temporary web-server rules or its own token handler. A successful HTTP status alone is not enough: the validator needs the correct response for the specific token. An application returning 200 for an unknown URL cannot substitute for the challenge content.
When an HTTP-to-HTTPS Redirect Breaks IPv4 Fallback
IPv4 retry has another limitation. Suppose the initial IPv6 connection times out, so the validator retries HTTP-01 over IPv4. The IPv4 server responds with an HTTP-to-HTTPS redirect. For the next request, Let’s Encrypt again prefers IPv6, but IPv4 fallback is no longer available. If this IPv6 connection also times out, validation may fail.
Removing the HTTP-to-HTTPS redirect for the challenge path can help in this specific sequence: an initial IPv6 timeout, a successful IPv4 retry, a redirect, and another IPv6 timeout without fallback. It is not a general workaround for an incorrect AAAA record. It will not fix an IPv6 server returning 404 or an incorrect token, nor will it resolve connection refused. The proper fix is working IPv6 connectivity or removal of an unnecessary AAAA record.
Check DNS for Every Name on the Certificate
Inspect both record types:
dig A example.com
dig AAAA example.com
If the certificate covers both example.com and www.example.com, check www separately:
dig +short A www.example.com
dig +short AAAA www.example.com
The main domain and www may resolve differently, including through a CNAME. A correct AAAA record for one name says nothing about the other. If several addresses exist within one address family, each may be selected by the validator. Testing one IPv6 address does not establish that every published address works.
For a name resolved through a CNAME, examine the addresses returned for the final target. A DNS control panel may show only part of the resolution chain.
Compare any unexpected IPv6 address with the current infrastructure and the DNS provider’s configuration. It may have survived a migration, been created by a zone template or been managed separately from the A record.
If IPv6 terminates at a proxy or load balancer, inspect that entry point. The address may not appear in ip -6 addr on the application server, which is normal in that setup. What matters is where the incoming connection terminates and which system generates the HTTP-01 response.
Check Authoritative DNS and TTL
After changing an AAAA record, a recursive resolver may continue returning the old address until its cached record expires. Find the authoritative name servers:
dig NS example.com
Query one directly:
dig @ns1.example-dns.net AAAA example.com
Replace ns1.example-dns.net with an actual authoritative server for the zone. If several authoritative servers return different answers, check each one: the zone itself may be inconsistent.
If authoritative DNS is correct but a recursive resolver still returns the previous address, account for the remaining TTL. If the authoritative answer is wrong, waiting for “DNS propagation” will not correct it.
Repeat the check for the exact hostname being validated, not just the zone apex. A subdomain may retain an incorrect AAAA record after the main domain has been fixed. Keep the authoritative and recursive results together with the time of each check.
Compare HTTP Responses Over IPv4 and IPv6
From an external machine with working access to both networks, run:
curl -4 -v http://example.com/
curl -6 -v http://example.com/
Compare the destination address, connection result, HTTP status, headers and redirects. IPv4 may reach the correct website while IPv6 returns another virtual host, a 404 or a page from the previous server.
The verbose curl output shows which address was selected and whether the TCP connection succeeded. If the connection succeeds but the response is wrong, investigate the request handler on the server reached rather than assuming a routing failure.
A machine without working outbound IPv6 cannot reliably test a remote website using curl -6. Testing from the web server itself is not a substitute for an external check either, because local routing may bypass provider-level filters.
If the domain has several IPv6 addresses, curl --resolve can target each address while retaining the original hostname and Host header. This does not change public DNS records.
Test /.well-known/acme-challenge/ Separately
The homepage may work over both protocols while the challenge path is handled differently. Causes include Nginx location rules, Apache VirtualHost configuration, a different ACME webroot, a reverse proxy or URL rewriting.
Place a temporary file containing known, harmless text in the directory actually serving HTTP-01. For example:
http://example.com/.well-known/acme-challenge/ipv6-test
Request it from an external machine:
curl -4 -v http://example.com/.well-known/acme-challenge/ipv6-test
curl -6 -v http://example.com/.well-known/acme-challenge/ipv6-test
Both requests should reach the intended handler and return identical test content. Compare the response body, not just status 200: the application might be returning its own page instead of the file. Examine redirects separately.
This test confirms access to the temporary file, but not that the ACME client uses the same directory or configuration. Delete only the test file afterwards, leaving active challenge tokens untouched.
Check the IPv6 Listener and Virtual Host
If AAAA points to the current infrastructure, establish whether the correct entry point has the IPv6 address. On Linux:
ip -6 addr
Check listening TCP sockets:
ss -lntp
Inspecting process details may require administrator privileges. Look for port 80 and check whether the web server accepts IPv6 connections. If a load balancer handles incoming traffic, the address may not exist on the application server itself.
On a server with administrative access, you can compare the IPv6 listener, the virtual host selected for the required Host header and the ACME challenge handler. For Nginx, inspect server and location selection. For Apache, check VirtualHost and redirect rules. A reverse proxy may also replace the response or route the request to another application.
Do not blindly add listen [::]:80. The result depends on existing listeners, ipv6only, virtual hosts and the server configuration. Check configuration syntax before applying changes, then repeat the request externally. A local listening socket does not establish public reachability.
Pay particular attention to the virtual host name. Several websites may share one IPv6 address, and a request with the correct Host header must reach the configuration serving the current challenge. Testing the literal IPv6 address alone is insufficient.
Rule Out IPv6 Firewall Filtering
A web server may listen on port 80 while incoming IPv6 traffic is blocked by the host firewall, cloud security rules, provider filtering or an external firewall. Check the path from the external client to the server. Allowing HTTP over IPv4 does not mean equivalent IPv6 rules exist.
If requests work inside the server’s network but an external curl -6 cannot connect, compare host rules, provider settings and intermediate network devices. Do not change the entire access policy when the investigation concerns a particular TCP port and published address.
HTTP-01 requires public TCP/80 access at the correct entry point, not unrestricted access to every IPv6 port. Restricting access to a handful of presumed Let’s Encrypt validator addresses is unreliable: no fixed list of validator IP addresses is published, and validation requests may originate from different networks.
Distinguish Timeout, Connection Refused and an Incorrect HTTP Response
A connection timeout means the connection could not be established within the allotted time. Only when the initial IPv6 connection times out may Let’s Encrypt retry HTTP-01 over IPv4, provided IPv4 is available. This fallback does not apply after a redirect.
With connection refused, the documented IPv6-to-IPv4 fallback does not take place: Let’s Encrypt provides it only for a timeout on the initial IPv6 connection.
An incorrect HTTP response means the IPv6 connection succeeded, but the server returned 404, another website’s content or an invalid token. Let’s Encrypt does not switch to IPv4 merely because the response is wrong.
These failures call for different checks. A timeout points towards routing or filtering, a refused connection towards listeners and port access, and an incorrect HTTP response towards virtual-host selection and the challenge handler.
Examine the ACME Client Log
A generic certificate renewal failure is not enough to diagnose the problem. Inspect the log for the actual attempt, looking for the validator’s destination address, a timeout, connection error, 404, unauthorized or an incorrect challenge response.
For Certbot, the usual log location is:
/var/log/letsencrypt/letsencrypt.log
Match the failure time to DNS records and external request results. Record the hostname, destination address and server response at each stage; otherwise observations from separate attempts are difficult to correlate.
If the error identifies a particular IPv6 address, compare it with the current authoritative DNS response. After a recent DNS change, the validator may still have used a cached address.
For a 404, identify which virtual host returned it. For a timeout, check whether an incoming connection reached the expected server. Other ACME clients, including those integrated into hosting control panels, have their own logs and commands, although they use the same HTTP-01 validation mechanism.
Correct or Remove the AAAA Record
If IPv6 is required, the AAAA record must point to the active entry point. Assign the correct address, make TCP/80 accessible, configure the appropriate virtual host and ensure the current challenge is served on every published address.
If the website is not intended to use IPv6, remove the incorrect AAAA record from authoritative DNS and allow recursive caches to expire according to TTL.
Do not disable working IPv6 simply to renew the certificate more quickly. Nor should you look for an option to force Let’s Encrypt to prefer IPv4. Its documentation states that you cannot request this behaviour from the certificate authority. Fix DNS or the IPv6 configuration instead.
Worked Example: An AAAA Record Left Behind After Migration
Suppose a website is migrated to a new server, but only its A record is updated. The following addresses come from ranges reserved for documentation:
example.com A 203.0.113.20
example.com AAAA 2001:db8:10::20
IPv4 reaches the new server; IPv6 still reaches the old one. Port 80 is open there, but the current token is absent from /.well-known/acme-challenge/TOKEN.
A visitor using IPv4 sees the website and its valid certificate, with no obvious problem. During renewal, Let’s Encrypt prefers IPv6, receives 404 from the old server and does not retry over the working IPv4 address. The HTTP connection has already succeeded.
The administrator compares the A and AAAA results from dig, checks the challenge path using curl -4 and curl -6, and finds different responses. After checking authoritative DNS, the incorrect AAAA record is either updated to the new server’s IPv6 address or removed if IPv6 is not used.
Once the relevant DNS caches have expired, DNS and HTTP checks are repeated. If AAAA now points to the new server, port 80 and the challenge path must also be tested over IPv6. Changing DNS alone is insufficient if the web server still handles only IPv4.
If AAAA was removed, confirm that authoritative DNS no longer publishes it for any certificate hostname. This is an illustrative scenario, not an actual Era.Host incident.
Repeat the Checks and Run a Test Renewal
After the fix, compare authoritative and recursive DNS responses for every name on the certificate. Confirm that each published address reaches the intended server, TCP/80 is externally accessible, and curl -4 and curl -6 return the expected challenge content. Check that redirects do not lead to an incorrectly configured IPv6 endpoint.
If AAAA was removed, authoritative servers should no longer publish it.
For Certbot, run a test renewal:
certbot renew --dry-run
By default, --dry-run uses Let’s Encrypt’s staging environment and does not save the test certificate to disk. Check the existing Certbot configuration first: hooks and temporary web-server configuration changes may still run during a dry run. Parameters for testing an individual certificate depend on its configuration. Avoid repeatedly attempting production issuance without correcting the failure.
A successful test renewal confirms that the current configuration can pass ACME validation. A local dig result, a working homepage or an accessible test file cannot establish that on its own.
A working IPv4 path does not fix a misconfigured IPv6 path. If a domain publishes AAAA, that address must serve HTTP-01 correctly, or the record should be removed when IPv6 is not in use.
