A failed challenge blocks issuance. Use the Certbot error to check the public HTTP challenge path or DNS TXT record, then retest the same request in staging. The ACME certificate authority must read a proof for every requested name before Certbot receives a certificate.

Certbot failed to authenticate some domains and Some challenges have failed report the same event: the certificate authority could not read the proof for a name. HTTP-01 failures come from the public port 80 route that serves /.well-known/acme-challenge/, and the failing host can still load its normal website while that path returns a default virtual host, login page, CDN block, stale cache, broken IPv6 listener, or missing file.

DNS-01 failures come from the TXT owner, value, delegation, or propagation timing for _acme-challenge. An authoritative nameserver shows what is published, while a public resolver can repeat an older answer until its TTL expires, so the two answers separate an unpublished record from a cached one. Production failures count against the certificate authority's rate limits, which makes the staging service the place to retest.

Steps to troubleshoot Certbot challenge failures:

  1. Rerun the failed request once with --dry-run to save the exact error.
    $ sudo certbot certonly --webroot -w /var/www/www.example.com -d www.example.com --dry-run
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Simulating a certificate request for www.example.com
    
    Certbot failed to authenticate some domains (authenticator: webroot). The Certificate Authority reported these problems:
      Identifier: www.example.com
      Type:   unauthorized
      Detail: 203.0.113.10: Invalid response from http://www.example.com/.well-known/acme-challenge/<challenge-token>: 404
    
    Hint: The Certificate Authority failed to download the temporary challenge files created by Certbot. Ensure that the listed identifiers serve their content from the provided --webroot-path/-w and that files created there can be downloaded from the internet.
    
    Some challenges have failed.
    Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

    Do not keep running the production command while this error is unresolved. Certbot's default certificate authority allows five failed authorizations per hour for the same identifier and account, and then refuses new orders for that name. A --dry-run request tests the same challenge path against the staging service, which has a much higher limit.

    Older Certbot releases print Domain: instead of Identifier: and “listed domains” instead of “listed identifiers” in the same error. --dry-run works only with certonly and renew, so test a failed sudo certbot --nginx request with sudo certbot certonly --nginx, and a failed renewal with sudo certbot renew --cert-name www.example.com --dry-run.
    Related: Test Certbot certificate renewal

  2. Match the authenticator in the error to the challenge type.
    Authenticator    Challenge
    webroot          HTTP-01
    nginx, apache    HTTP-01
    standalone       HTTP-01
    dns-<provider>   DNS-01
    manual           Named in the hint

    A manual hint names “challenge files” for HTTP-01 and “DNS TXT records” for DNS-01. For HTTP-01, continue with Fix an HTTP-01 failure. For DNS-01, continue with Fix a DNS-01 failure. Each section runs through to a working certificate.

Fix an HTTP-01 failure

  1. Create the challenge directory in the webroot used by the failed command.
    $ sudo mkdir -p /var/www/www.example.com/.well-known/acme-challenge

    The nginx and apache authenticators answer from their own temporary rule, so a test file in the document root only shows that port 80 reaches the right site. standalone has nothing listening on port 80 between runs, so skip the test file and go straight to the fix for a timeout.

  2. Create a test file named test in that directory containing the word ok.
    $ sudoedit /var/www/www.example.com/.well-known/acme-challenge/test
    ok
  3. Request the test file from a computer outside the server's network.
    $ curl -i http://www.example.com/.well-known/acme-challenge/test
    HTTP/1.1 404 File not found
    Server: nginx/1.28.3 (Ubuntu)
    ##### snipped #####

    A request from the server itself can succeed while the public route fails.
    Tool: ACME HTTP 01 Readiness Validator

  4. Fix the cause that matches the response.

    If the hostname does not resolve, or the address at the start of the Detail line is not this server, correct the hostname's A or AAAA record at your DNS provider.
    If a site that serves files returns a 404, find its real directory in the root line of sudo nginx -T or the Apache DocumentRoot, repeat the directory and test file steps there, and use that path as -w.
    If a proxied application answers, exclude the challenge path from the proxy so the -w directory serves it, as the next step shows for Nginx.
    If the response is a 403 or login page, allow the path in the web server, WAF, or access rule.
    If the request times out or is refused, open or forward port 80 through the firewall, load balancer, or router.
    If the response is a stale token or cached copy, bypass or purge the CDN or cache for the path.

    A 301 or 302 to HTTPS is not a failure, because the validator follows it without checking the certificate. Run curl -iLk with the same URL to see the final response.

  5. Add this block before the location / { line of the Nginx site file when a webroot site proxies to an application.
    $ sudoedit /etc/nginx/sites-available/www.example.com
        location ^~ /.well-known/acme-challenge/ {
            root /var/www/www.example.com;
        }

    The block takes effect once sudo nginx -t passes and sudo systemctl reload nginx has run. Any other fix skips this step.

  6. Repeat the request from the outside computer.
    $ curl -i http://www.example.com/.well-known/acme-challenge/test
    HTTP/1.1 200 OK
    Server: nginx/1.28.3 (Ubuntu)
    ##### snipped #####
    
    ok

    If the hostname has an AAAA record, also run curl -6 -i with the same URL, because Certbot's default certificate authority tries IPv6 first and an IPv6 listener that returns the wrong site still fails validation. Correct the AAAA record, add listen [::]:80; to the Nginx server block, or remove the AAAA record if the site should not use IPv6.

  7. Remove the test file.
    $ sudo rm /var/www/www.example.com/.well-known/acme-challenge/test

    After a -w correction, remove it from both directories.

  8. Retest the original request against staging.
    $ sudo certbot certonly --webroot -w /var/www/www.example.com -d www.example.com --dry-run
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Simulating a certificate request for www.example.com
    The dry run was successful.

    Keep the same authenticator, domain list, and challenge options used by the failed request, changing -w only when it was the cause.

  9. Request the production certificate once after the staging test succeeds.
    $ sudo certbot certonly --webroot -w /var/www/www.example.com -d www.example.com
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Requesting a certificate for www.example.com
    
    Successfully received certificate.
    Certificate is saved at: /etc/letsencrypt/live/www.example.com/fullchain.pem
    Key is saved at:         /etc/letsencrypt/live/www.example.com/privkey.pem
    This certificate expires on 2027-02-04.
    ##### snipped #####

    Remove --dry-run, --test-cert, and any staging --server override before the production request. A successful staging certificate is intentionally untrusted by normal browsers.

Fix a DNS-01 failure

  1. Rerun the failed manual request with --dry-run and leave it waiting at the prompt.
    $ sudo certbot certonly --manual --preferred-challenges dns -d www.example.com --dry-run
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Simulating a certificate request for www.example.com
    
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Please deploy a DNS TXT record under the name:
    
    _acme-challenge.www.example.com.
    
    with the following value:
    
    -DRP2igtKEN-PKO4DujHbSgDifGxTe7Kxio10x9nUlc
    ##### snipped #####
    Press Enter to Continue

    A dns-<provider> plugin adds and removes the record itself, so follow its hint instead of pausing, usually by raising --dns-<provider>-propagation-seconds, then rerun the plugin command with --dry-run and again without it. dns-route53 has no such option and asks you to confirm that Route 53 hosts the domain's DNS.

  2. Add the name and value from the prompt as a TXT record at your DNS provider.

    Every attempt prints a new value, so a record left from an earlier attempt fails with Incorrect TXT record. A missing record fails with No TXT record found or NXDOMAIN. Providers that append the zone name expect _acme-challenge.www as the record name. Older TXT values at the same name do not block validation, so remove them after the request succeeds.

  3. List the authoritative nameservers for the zone.
    $ dig +short NS example.com
    ns1.example.com.
  4. Ask a listed nameserver for the TXT record.
    $ dig @ns1.example.com +short TXT _acme-challenge.www.example.com
    "-DRP2igtKEN-PKO4DujHbSgDifGxTe7Kxio10x9nUlc"

    An empty answer or a different value means the current value is not published yet, so correct it at the provider and ask again. A CNAME answer means the name is delegated, so ask the nameservers of the target zone. Each listed nameserver must return the current value.
    Tool: ACME DNS Challenge Readiness Check

    A public resolver such as dig @1.1.1.1 TXT _acme-challenge.www.example.com can repeat an older value here. That is a cached answer rather than an unpublished record, and it clears when the TTL in the second column of the answer runs out.

  5. Press Enter in the waiting Certbot session to retest the request against staging.
    The dry run was successful.
  6. Request the production certificate once after the staging test succeeds.
    $ sudo certbot certonly --manual --preferred-challenges dns -d www.example.com
    Saving debug log to /var/log/letsencrypt/letsencrypt.log
    Requesting a certificate for www.example.com
    
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Please deploy a DNS TXT record under the name:
    
    _acme-challenge.www.example.com.
    
    with the following value:
    
    DUQZWEcvlY3fa_cO6G3TLv-mqDsdpGJ3ZfJKXh-WVMo
    ##### snipped #####
    Press Enter to Continue
    
    Successfully received certificate.
    Certificate is saved at: /etc/letsencrypt/live/www.example.com/fullchain.pem
    Key is saved at:         /etc/letsencrypt/live/www.example.com/privkey.pem
    This certificate expires on 2027-02-04.
    ##### snipped #####

    This attempt prints a new value, so publish it at the same name before pressing Enter.

Share this guide