My domain is: *.abc.atlasinbox.com
I ran this command: certbot certonly --manual --preferred-challenges=dns --register-unsafely-without-email --agree-tos -d *.abc.atlasinbox.com
It produced this output: Congratulations! etc… - the certificate was created and verified successfully.
My web server is (include version): Apache/2.4.29 (Ubuntu)
The operating system my web server runs on is (include version): Ubuntu 18.04.1 LTS
My hosting provider, if applicable, is: Linode
I can login to a root shell on my machine (yes or no, or I don’t know): yes
I’m using a control panel to manage my site: no
The version of my client is: certbot 0.26.1
The problem is very strange. Here are the steps I take:
I create a standard apache virtualhost:
<VirtualHost *:80>
ServerAdmin contact@localhost
ServerName abc.atlasinbox.com
ServerAlias *.abc.atlasinbox.com
DocumentRoot /var/www/test
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I visit these domains in the browser:
http://a1.abc.atlasinbox.com
http://a2.abc.atlasinbox.com
The URLs work, the html loads properly.
Now I create a wildcard SSL domain:
<VirtualHost *:443>
ServerAdmin contact@localhost
ServerName abc.atlasinbox.com
ServerAlias *.abc.atlasinbox.com
DocumentRoot /var/www/test
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLCertificateFile /etc/letsencrypt/live/abc.atlasinbox.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/abc.atlasinbox.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
I generate and verify the certificate for it:
certbot certonly --manual --preferred-challenges=dns --register-unsafely-without-email --agree-tos -d *.abc.atlasinbox.com
I reload the server.
Now if I navigate to any of these 4 subdomains, they load properly:
http://a1.abc.atlasinbox.com
http://a2.abc.atlasinbox.com
https://a1.abc.atlasinbox.com
https://a2.abc.atlasinbox.com
But if I navigate to any other subdomain, they won’t work. For example:
http://a3.abc.atlasinbox.com
https://a3.abc.atlasinbox.com
will generate this error in the browser:
This site can't be reached
a3.abc.atlasinbox.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
You can’t ping it… it just doesn’t exist.
I tried different browsers, incognito modes, I tried several different subdomains, and I can always reproduce this problem: if I visit the URL before I set up the certificate, it will work; if I don’t, it won’t work, even without SSL.
I’m out of ideas… any help would be appreciated. Thank you!