Using two domains on one server

Hello, I have a web server that is running, and a mailinabox server. The mailinabox server is hosted on server1.com, which I intend to send and receive mail to/from john.doe@server1.com (IP of 1.1.1.1). I have another server, a web server, which will have an SMTP client, let’s call this server2.com (IP of 2.2.2.2). I wish to also send and receive mail to/from noreply@server2.com , but the mail server for noreply@server2.com is actually server1.com .

So I setup on my Namecheap account this:

server1.com:

HOST| type | value
@ | A | 1.1.1.1
@ | AAAA | 1111:1111:1111:1111:1111:1111
@ | TXT | v=spf1 mx -all
@ | TXT | v=DMARC1; p=quarantine
@ | TXT | v=DKIM1; k=rsa; s=email; p=blawblawblawblawblawblawblawthing

server2.com:

HOST | type | value
@ | A | 2.2.2.2
@ | AAAA | 2222:2222:2222:2222:2222:2222
@ | MX | server2.com priority=10

The thing is, I would like to continue to use Namecheap’s DNS server for my records, so changing the glue/nameserver record to my MIAB server isn’t something I want. I also cannot change the A/AAAA record for server2.com, as that would not allow the webserver to be a webserver.

The most confusing part is that in the MIAB control panel, under System > External DNS > server2.com there are two entries that are confusing:

server2.com A 1.1.1.1

and

server2.com TXT v=spf1 mx -all
Recommended. Specifies that only the box is permitted to send @server2.com mail.

So how does the SPF record allow mail to be send from server1.com? And why is it suggesting that the A record for server2.com point to 1.1.1.1?

In the configuration that you have described, you would ignore the A record for server2.com as DNS is being handled by NameCheap. IF you were using MiaB for DNS you would need to set a Custom DNS entry for the A and AAAA records on server2.com as MiaB assumes that you are hosting the web page on its web server (server 1) unless you tell it otherwise. You are seeing 1.1.1.1 because you have not told MiaB otherwise.

The SPF record is saying that a recipient should only consider mail coming from the MX record for this domain (server 1) as being valid. If mail is received from a different IP address then it fails the SPF check. The receiving mail server would then process the mail as it is configured to (spam, delete, deliver). The SPF record in itself does not ‘allow’ mail to be sent from a server … it’s purpose is to identify WHICH servers the domain owner considers to be a valid server for sending mail from their domain.

IF you are sending mail through SMTP from server 2 (your phpBB?), the mail is actually considered to be sent from server 1. Think of server 2 as being a Thunderbird email client … you compose an email and click send. Thunderbird then connects to the mail server, authenticates, and sends the mail. The exact same thing is happening here, your email client (phpBB) is connecting to the mail server, authenticating, and sending the mail from server1.

These are incorrect … there are 2 things wrong here … one can be overlooked and the other cannot. This below is how they should be:

server1.com:

HOST| type | value
@ | A | 1.1.1.1
@ | AAAA | 1111:1111:1111:1111:1111:1111
@ | TXT | v=spf1 mx -all
@ | TXT | v=DMARC1; p=quarantine
@ | TXT | v=DKIM1; k=rsa; s=email; p=blawblawblawblawblawblawblawthing
@ |MX| hostname.server1.com priority=10

server2.com:

HOST | type | value
@ | A | 2.2.2.2
@ | AAAA | 2222:2222:2222:2222:2222:2222
@ | MX | hostname.server1.com priority=10

On your DNS for server 1 you SHOULD have a MX record pointing to your MiaB hostname (box.server1.com ?). DNS will work without it, but it is not the proper way.

Your MX record for server2.com needs to point to the mail server which is hostname.server1.com.

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