Hi all, I was wondering if you had any idea as to why this may be happening.
I currently have virtualmin/webmin installed on a Debian machine which I use as a mail server for mutliple domains. The server has a hostname root.server.com, I have setup a virtualhost for root.server.com which is accessible from the internet. I use this vhost to obtain a SSL certificate from lets encrypt for the server. I use this for webmin as well as core services such as postfix, dovecot etc. This vhost has an apache website enabled but dns disabled as I host the DNS records elsewhere. The issue arises when I add more domains. If I add domain1.com and configure it to only receive mail (website and dns disabled) then if I got to domain1.com it serves root.domain.com files in public_html. Is this meant to be happening? I have disabled domain1.com’s website so nothing should be served or am I wrong? Is there any way to disable this? The email server works but this is just annoying and would be nice to get rid off.
Any help would be much appreciated, thanks in advance.
If you point a domain to the IP address of the server, and Apache does not have a website for the domain, it’ll serve up the “default” website which is typically the one setup first. So it’s serving up “root.server.com” since “domain1.com” does NOT have a website setup.
If you don’t want to serve up a website, don’t add an A record at your DNS provider to the server for “domain1.com”.
Hi there thank you very much, I now understand. The thing which confused me was the DNS MX record I always though it had to point to the Apache Vhost for the domain I didnt know it could point to the root server itself. Anyways we learn. Thank you for your help, I now have a fully working email server on a residential connection. Much appreciated.