I have server with multiple domains. And certbot works fine for all of them, excepts one. Let's use "blog.domain.staging.com" as example for this question.
certbot certonly -t -n --dry-run --agree-tos --renew-by-default --email "${LE_EMAIL}" --webroot -w /usr/share/nginx/html -d blog.domain.staging.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blog.domain.staging.com
Using the webroot path /usr/share/nginx/html for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. blog.domain.staging.com (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching https://blog.domain.staging.com.com/.well-known/acme-challenge/YWnMAB2mDZFl4-tEO1BCrKc3vP6yeAL2JVZP-A-BRV4: Error getting validation data
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: blog.domain.staging.com
Type: connection
Detail: Fetching
https://blog.domain.staging.com.com/.well-known/acme-challenge/YWnMAB2mDZFl4-tEO1BCrKc3vP6yeAL2JVZP-A-BRV4:
Error getting validation data
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address. Additionally, please check that
your computer has a publicly routable IP address and that no
firewalls are preventing the server from communicating with the
client. If you're using the webroot plugin, you should also verify
that you are serving files from the webroot path you provided.
You can see that hostname has additional ".com" and I don't know why and how to fix that.