Certbot needs a DNS A record set

By xngo on May 18, 2020

I was running certbot --apache to setup the SSL certificate for Apache server and I got the following error message.

Failed authorization procedure. pscdoc.com (http-01): urn:ietf:params:acme:error:unauthorized 
    :: The client lacks sufficient authorization :: Invalid response from 
    https://pscdoc.com/.well-known/acme-challenge/2-E0YjvS1234569EDFSFEF[35.248.116.211]: 
    "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n
    <title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p"

Solution

For certbot, you need a DNS A record to point to your IP address. Therefore, I created a DNS A record set for my domain name to point to the IP address of my website. To test out whether the DNS A record set is working or not, I wait for 30 minutes for the changes to be effective. Then, open my website using my domain name(e.g. http://pscdoc.com). The domain name does resolve. Finally, I re-run certbot --apache and the SSL certificate was created successfully.

DNS A record setting example

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.