SSL & Certs Advanced

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.

👨‍💻
Senior Systems Architect • Verified in Staging Labs

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:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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) and www subdomain (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.

  • 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 A
    

    Compare 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 whois or dig NS to find your domain's nameservers.

    whois example.com | grep "Name Server:"
    # OR
    dig +short example.com NS
    

    You'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 A
    

    If 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.conf
    

    Ensure you have valid and reachable nameserver entries (e.g., your ISP's DNS, Google's 8.8.8.8/8.8.4.4, Cloudflare's 1.1.1.1/1.0.0.1). If systemd-resolved is active, it might point to 127.0.0.53.

    # Generated by NetworkManager
    search localdomain
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    
  • Test Local DNS Resolution:

    ping google.com
    dig google.com
    

    If these commands fail, your server has local DNS issues, which could indirectly impact certbot.

    If systemd-resolved is managing /etc/resolv.conf and you're experiencing issues, you might try temporarily using static nameservers or restarting systemd-resolved.

    sudo systemctl restart systemd-resolved
    

    For 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 API
    
  • Firewall (firewalld): Ensure firewalld is 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-all
    

    Look for http and https in the services list or 80/tcp and 443/tcp in the ports list.

    If missing, add them (and make permanent):

    sudo firewall-cmd --add-service=http --permanent
    sudo firewall-cmd --add-service=https --permanent
    sudo firewall-cmd --reload
    

    Also, ensure outbound DNS (UDP/53, TCP/53) is not blocked, although this is rare for default firewalld configurations.

    If you are using a cloud provider (AWS, GCP, Azure, DigitalOcean, etc.), check their network security groups or firewall rules in addition to firewalld on 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's server_name directive 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 certbot is 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.com
    

    Let'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 certbot Logs:

    tail -f /var/log/letsencrypt/letsencrypt.log
    

    Look 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.

👨‍💻

Johnathon Wheeler

Senior Systems Architect & DevOps Engineer • Austin, TX

Connect on LinkedIn →

Johnathon has over 16 years of hands-on experience designing, debugging, and scaling Linux web hosting stacks, container clusters, and high-availability database architectures. Every guide on ButItWorkedLocal is independently tested against Debian 12, Ubuntu 24.04/22.04 LTS, Rocky Linux, and Docker environments to guarantee reproducibility in production.

🛡️

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.