4 servers with differen hostnames, but on the same domain

rsdrsd

Verified User
Joined
Jan 12, 2013
Messages
10
I have 4 servers on which I wnat to install Directadmin:
The hostnames of the servers will be:

srv1.domain.com (25.1.1.1)
srv2.domain.com (25.1.1.2)
srv3.domain.com (25.1.1.3)
srv4.domain.com (25.1.1.4)

www.domain.com is running on 25.1.1.1.

Now I wnat to setup the mail correctly also for Reverse DNS.
I have set Reverse DNS for ip's to the corresponding hostnames.

Now is my question, how can I send mail from all domainsm, because on srv1 there is the main domain with an MX record to mail.domain.com which goes to ip 25.1.1.1.

I also have set in the DNS for domain.com A records for srv2.domain.com to srv4.domain.com to the corresponding IP's.

How can I catchthe mail for [email protected] and is this setup good for all the mail policies.

Do I get problems with the mail on srv2 to srv4? Is the mail
 
You have 1 domain. What you put in front of it is subdomains or hostnames.
If you really want to do it correctly as it should be done, you can't use the same domain name on 4 servers and expect they will work all the same.

You should be able to send mail from all 4 servers, but you got 2 problems.
a.) returned mails and mails which people reply too, will always get back to your first server, because that's where the MX record -and- the main mail domain name resides.
b.) you could get in trouble with strict mailservers (maybe hotmail?) which could recognize that mail is send from a server where the domain isn't present.

Now there might be a way around this.
Maybe this can be fixed by using SPF records and setting them up correctly for each server.
You could also create multiple mx records, like mail.domain.com which points to the serv1 and mail2.domain.com which points to serv2 etc. The hostname is already provided by you and also provided with A records, but you have probably to create subdomains to be able to let people send mail to [email protected].

So probably (maybe) it can be done about this way, but I doubt that it's conform the RFC's.
I would just let 1 server catch all the mail for that domain.
And I would also use a seperate domain name on each server.
 
We use a similar configuration to the original poster.

We set the rDNS for each server from the server's main IP# to the servername.

This should always work since RFC compliant email servers require only that the rDNS for an IP# sending email points to a host with regular DNS to the same IP#

There's no reason at all why a server that sends or receives email for a domain needs to host the domain. This just isn't required and shouldn't be required. With our setup we have no problem sending email to hotmail or anyone else.

The MX record for the domain should always point to the host which receives email for the domain, and to nowhere else. MX simply means Mail Exchange; in other words, the host which handles incoming email for the domain.

Not complying with RFCs is more likely to give you problems with your email, and the RFC compliant method is very simple.

Jeff
 
Thank you for correcting me in this Jeff. I really did not know this and did not expect this.

If I think further, it should indeed not be a problem because you can also send mails via your internet providers smtp which are not hosted by that internet provider. However, in the headers, another hostname will be present. That is not a problem on sending mailservers.
So the sending part should be no problem, I understand.

But when I think about receiving mail. I don't understand though why a receiving server should not host the domainname.
I'm very confused that if your mx record points to that server, the domain name still can be hosted on another server.

If the domain name is not present, then neither is the email address of the user, how does the server know where to place the incoming mail for that user on the server without that domain name?
Shouldn't it reject the mail then because the user is not known, because the domain is not even present?
 
But when I think about receiving mail. I don't understand though why a receiving server should not host the domainname.
I'm very confused that if your mx record points to that server, the domain name still can be hosted on another server.
Perhaps I'm being a bit too simplistic in what I write. Generally when we say host the site or domainname, what we mean is that the website is hosted on that server. But you can host your email on a different server. Yes, you need all the files and records necessary to host the email on the server where you're hosting it, or you need that server set to relay to the eventual server accepting the mail (for example when using a commercial spamblocking appliance on it's own server).

Nowhere did I say it was easy to do with DirectAdmin :).
If the domain name is not present, then neither is the email address of the user, how does the server know where to place the incoming mail for that user on the server without that domain name?
If you're hosting email on a different physical server than the site, then that all must be set up on that different physical server.
Shouldn't it reject the mail then because the user is not known, because the domain is not even present?
Yes, unless it's set up properly for accepting or relaying the email.

Jeff
 
Generally when we say host the site or domainname, what we mean is that the website is hosted on that server.
Because we were talking about the working of a mailserver, I only thought of the domain name for mail, not for a website. So I did not know you meant that when you say "host the domain name".
Ofcourse website and mailserver can be hosted on seperate servers, and since I only thought of use of the mailserver in this question, I got a bit confused about what you wrote about the domain.
It's clear to me now what you mean.

I'm happy that my thoughts about the receiving part are correct. Indeed if you set it up as accepting to relaying you can create a different situation. I totally forgot about relaying, we almost never use that.

Thanks for the explanations.

@Rsdrsd: sorry for my mistake in my answer to you. Hope you can fix it now as you wish, due to the answers from Jeff.
 
Last edited:
Back
Top