Troubleshooting Let’s Encrypt HTTP-01 Challenge DNS Resolution Timeout on CentOS Stream / Rocky Linux
Resolve Let's Encrypt HTTP-01 DNS resolution timeouts on CentOS Stream/Rocky Linux. Diagnose DNS propagation, server network, and firewall issues.
Resolve Let's Encrypt HTTP-01 DNS resolution timeouts on CentOS Stream/Rocky Linux. Diagnose DNS propagation, server network, and firewall issues.
When attempting to obtain or renew a Let's Encrypt SSL certificate using the certbot client on a CentOS Stream or Rocky Linux server, you might encounter an "HTTP-01 challenge DNS resolution timeout" error. This specific error indicates that the Let's Encrypt validation servers were unable to resolve the domain name(s) you are trying to secure, preventing them from connecting to your server to perform the HTTP-01 challenge. This guide will walk you through diagnosing and resolving the underlying DNS and network issues.
Symptom & Error Signature
Typically, when running certbot (e.g., certbot renew or certbot --nginx), the process will fail with an error message similar to the following:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Renewing an existing certificate for example.com and www.example.com
An unexpected error occurred:
The ACME server could not connect to the client to verify the domain :: DNS problem: query timed out looking up A for example.com
Please see the logfile '/var/log/letsencrypt/letsencrypt.log' for more details.
Or a more explicit message:
Challenge failed for domain example.com
http-01 challenge for example.com
Cleaning up challenges
Some challenges have failed.
IMPORTANT: The following errors were reported by the ACME server:
Domain: example.com
Type: dns :: DNS problem: query timed out looking up A for example.com
Detail: DNS resolution timed out
The key phrase here is DNS problem: query timed out looking up A for example.com or DNS resolution timed out.
Root Cause Analysis
A "DNS resolution timeout" during the HTTP-01 challenge explicitly means that the Let's Encrypt validation servers could not translate your domain name (e.g., example.com) into an IP address. This is a critical first step for the challenge, as they need to know where to send the HTTP request. The common root causes are:
- Incorrect or Missing Public DNS Records: The A (IPv4) or AAAA (IPv6) records for your domain(s) are either not configured, are pointing to the wrong IP address, or have been recently changed and have not fully propagated globally.
- Unresponsive or Misconfigured Authoritative Nameservers: The DNS servers responsible for your domain (configured at your domain registrar) are down, overloaded, or incorrectly configured, preventing Let's Encrypt from querying them.
- DNS Propagation Delays: If you've recently changed your domain's DNS records, it can take some time (up to 48 hours, though usually much faster) for these changes to propagate across the internet. Let's Encrypt uses geographically diverse validators, so partial propagation can cause issues.
- Firewall or Network Restrictions (Less common for DNS timeout itself, but can prevent challenge): While less likely to cause a DNS resolution timeout directly (as that's an external process), an improperly configured firewall on your server could prevent other necessary network operations or confuse external checks if it blocks outbound DNS queries from your server that Certbot might perform. More relevant is that your firewall must allow inbound HTTP (port 80) traffic.
- DNSSEC Issues: Incorrectly configured DNSSEC (DNS Security Extensions) for your domain can cause validation failures if some resolvers validate DNSSEC and others don't, or if the DNSSEC chain is broken.
Step-by-Step Resolution
Follow these steps to diagnose and resolve the "DNS resolution timeout" issue.
1. Verify Public DNS Records for Your Domain
The most common culprit is incorrect or stale public DNS records.
Check A/AAAA Records: Use an online DNS lookup tool (e.g., dnschecker.org, whatsmydns.net) to verify that your domain's A (and AAAA if applicable) records correctly point to the public IP address of your CentOS Stream/Rocky Linux server.
- Ensure both the bare domain (
example.com) andwwwsubdomain (www.example.com) have correct records if you're securing both.
The IP address your domain resolves to MUST be the public IP of the server running Nginx and Certbot, and that server must be reachable on port 80 (HTTP) from the internet.
- Ensure both the bare domain (
Local Server Check: From your server, you can also perform a DNS lookup to see what it resolves to locally, though this is less indicative of what Let's Encrypt's validators see.
dig +short example.com A dig +short www.example.com ACompare the output IP addresses with your server's actual public IP. If they don't match, you need to update your domain's DNS records at your domain registrar or DNS hosting provider.
2. Check Authoritative Nameserver Health
If your DNS records are correct but propagation is slow, or if the lookup tools show inconsistent results, your authoritative nameservers might be having issues.
Find Authoritative Nameservers: Use
whoisordig NSto find your domain's nameservers.whois example.com | grep "Name Server:" # OR dig +short example.com NSYou'll get output like
ns1.nameserverprovider.com,ns2.nameserverprovider.com.Directly Query Nameservers: Test querying your domain's records directly from these nameservers.
dig @ns1.nameserverprovider.com example.com A dig @ns2.nameserverprovider.com example.com AIf these queries fail or time out, it indicates a problem with your DNS provider's nameservers. Contact their support.
3. Inspect Server's Local DNS Resolver Configuration
While the "DNS resolution timeout" typically refers to Let's Encrypt's external resolution of your domain, ensuring your server's local DNS resolution is healthy is also good practice, as certbot itself might need to resolve ACME server hostnames.
Check
/etc/resolv.conf: This file configures the DNS resolvers your server uses.cat /etc/resolv.confEnsure you have valid and reachable
nameserverentries (e.g., your ISP's DNS, Google's8.8.8.8/8.8.4.4, Cloudflare's1.1.1.1/1.0.0.1). Ifsystemd-resolvedis active, it might point to127.0.0.53.# Generated by NetworkManager search localdomain nameserver 8.8.8.8 nameserver 8.8.4.4Test Local DNS Resolution:
ping google.com dig google.comIf these commands fail, your server has local DNS issues, which could indirectly impact
certbot.If
systemd-resolvedis managing/etc/resolv.confand you're experiencing issues, you might try temporarily using static nameservers or restartingsystemd-resolved.sudo systemctl restart systemd-resolvedFor more persistent changes, edit
/etc/NetworkManager/conf.d/dns.conf(or similar) or modify network interface settings.
4. Verify Network Connectivity and Firewalld Configuration
Confirm your server can reach the internet and that its firewall allows necessary traffic.
Basic Connectivity:
ping 8.8.8.8 # Test outbound connectivity to a reliable IP curl -v https://acme-v02.api.letsencrypt.org/directory # Test connectivity to Let's Encrypt APIFirewall (
firewalld): Ensurefirewalldis allowing inbound HTTP (port 80) and HTTPS (port 443) traffic, as the HTTP-01 challenge requires Let's Encrypt to reach your server on port 80. While it usually doesn't cause a DNS resolution timeout, it's essential for the challenge to succeed.sudo firewall-cmd --list-allLook for
httpandhttpsin theserviceslist or80/tcpand443/tcpin theportslist.If missing, add them (and make permanent):
sudo firewall-cmd --add-service=http --permanent sudo firewall-cmd --add-service=https --permanent sudo firewall-cmd --reloadAlso, ensure outbound DNS (UDP/53, TCP/53) is not blocked, although this is rare for default
firewalldconfigurations.If you are using a cloud provider (AWS, GCP, Azure, DigitalOcean, etc.), check their network security groups or firewall rules in addition to
firewalldon your server. These external firewalls can block traffic before it even reaches your OS firewall.
5. Check Nginx Server Blocks and Certbot Configuration
While not directly a DNS resolution timeout cause, incorrect Nginx configuration can lead to challenge failures. Ensure certbot can correctly place and serve the challenge file.
Nginx
server_name: Make sure your Nginx server block'sserver_namedirective matches the domain(s) you are trying to secure.# /etc/nginx/conf.d/example.com.conf server { listen 80; server_name example.com www.example.com; # MUST match domains # ... other configurations location /.well-known/acme-challenge/ { root /var/www/certbot; # Or your webroot Certbot uses } # ... }If
certbotis managing Nginx, it usually handles this. If you are doing manual or webroot challenges, ensure the webroot is correctly configured.Test Nginx Configuration:
sudo nginx -t sudo systemctl reload nginx
6. Patience and Retry
If you've recently updated DNS records, wait for global propagation. This can sometimes take 5-15 minutes, but occasionally longer.
Retry Certbot: After performing checks and making any necessary changes, wait a few minutes and then retry
certbot.sudo certbot renew --force-renewal # Use --force-renewal if you want to retry immediately even if not due for renewal # OR sudo certbot --nginx -d example.com -d www.example.comLet's Encrypt has rate limits. If you attempt too many failed certificate issuances/renewals in a short period, you might hit these limits. Always verify your DNS and server configuration before retrying multiple times.
7. Consult Let's Encrypt Logs for More Detail
The certbot log files can provide more specific details if the generic error message isn't enough.
Review
certbotLogs:tail -f /var/log/letsencrypt/letsencrypt.logLook for more detailed error messages or specific IP addresses that Let's Encrypt was trying to reach.
By systematically going through these steps, you should be able to identify and resolve the underlying cause of the "DNS resolution timeout" when obtaining or renewing Let's Encrypt certificates on your CentOS Stream or Rocky Linux server.
Our Production Verification Guarantee
Encountering a bug not covered here or running a non-standard kernel configuration? Our solutions are continually refined against real production incidents. Submit an environment trace for our editorial team to replicate.