It’s no problem to have a mail server for a given domain/sub-domain on a different server, and doing that is just a matter of setting the MX record like how you described.
The only issue is that you’d need to setup that other server to accept email for that domain, and setup your users on the mail server.
You could do that by installing Virtualmin on your mail server, create the same Virtual Server on the mail server, and then set it up with the “Mail for Domain” feature.
Also, make sure “Mail for Domain” is disabled for that domain on the web server.
the mailserver for foo.com is server01, where the domain foo.com is located. the mailserver mail2. is located on server02 where test.foo.com is located. Both are running virtualmin but if i send a mail to blah@test.foo.com, it gets returned due to a Host or domain name not found. Name service error
for name
in my registry provider i can add subdomains as much as i need, also other mx entries, but i cannot assign a specific mailserver to a specific subdomain.
Which is what confuses me.
I have now several servers, some with no virtualmin, some with 10 domains running on it. To streamline everything i would like to change the hostnames (in underlying OS). WIll this lead to problems with webmin and virtualmin? I would also create the hostnames as webservers, so i can maintain a generic installation of phpmyadmin, roundcube etc. Could this work out? i also would have to swap the main server ip on one server as well and do not want to rebuild everything.
Thanks and best
j_m
PS: Would i have to change the dns entries in bind 9 so to point to the mail2. mailserver on the second one?