Mutliple domains pointing to one server

I just set up a certificate for our main domain using the certbot-auto.
All seems fine with our primary domain.

We have additional iterations of our domain .net, .org… etc.
if a user uses www.domain.net or domain2.net they get stopped by Chrome/Firefox with the
"This server could not prove that it is domain2.net; its security certificate is from domain1.com. This may be caused by a misconfiguration or an attacker intercepting your connection." pop up.

We are using an A record to redirect domain2.com to domain1.com

What are we doing wrong?
And in the mean time is there an easy way to reverse what certbot-auto did? as right now traffic has dropped off…

Disregard last part; I just restored a snapshot from yesterday. Traffic has been restored. Would still like to figure out how to enable security certificate for multiple domains pointing to 1 IP…

If you’re using certbot with the apache plugin, it will look at the ServerName and ServerAlias directives of your vhost to figure out which domains should be included in the certificate. If you have alternative domains that also need to be available via HTTPS, you should add those to your ServerAlias directive. You might have something like this in your vhost:

ServerName example.com
ServerAlias www.example.com example.org www.example.org

If you need add domains at a later point, you should be able to do that by adding another ServerAlias and then re-running certbot.

Great! Thank you. I will give that a try.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.