4

I have searched in google before asking here. I got a mixed answer in google.

Can i have a multiple MX record from different mail providers?

Example,

Zoho Mail

user1@example.com 
user2@example.com

Google Webmail

user3@example.com
user4@example.com

Rediffmail business

user5@example.com
user6@example.com 

Is this possible?

Mehul Kumar
  • 141
  • 1
  • 4
  • Althou technically, you can do this - it does not mean it is a good idea, but rather a horrible idea. – Orphans Jan 02 '23 at 08:40
  • @Orphans how to do? – Mehul Kumar Jan 02 '23 at 09:10
  • 1
    Set two different MX with same value. Mail will randomly be delivered to one of them. You ***can't*** set MX per user as you want. You'll need a frontend MTA that handles all mail and forwards according to a table. – vidarlo Jan 02 '23 at 09:32

3 Answers3

3

Can I have a multiple MX records for different mail providers?

No.

How many MX Records can I set up?

Each domain can only have 1 MX record at a time, allowing mail to only be delivered to that one service. So, if you have multiple mail accounts using the same domain, you will find that only one of those services is actually receiving and sending mail.

Source: Everything You Need To Know About MX Records | ServiceScaler

While you can set up more than one MX server for a given domain, this is purely a backup function to specify another server to receive mail when one server goes down. It's not possible to let two totally different services both handle your mail for the same domain

Source: Is it possible to set two MX records for one domain? - Server Fault, answer by Sven

Dual MX records are used for backup purposes, i.e. if you list more than 1 MX record for a domain, any host attempting to deliver email for that domain will only attempt such delivery to 1 MX at a time.

Source: Is it possible to set two MX records for one domain? - Server Fault, answer by ThatGraemeGuy

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
  • 6
    You can very well have multiple MX records, and even multiple MX records with the same priority. It won't achieve what OP wants, but the explanation is incorrect. – jcaron Jan 02 '23 at 16:27
  • @jcaron what if two different MX record with same Priority? Mail will be delivered to both of them or any one randomly? – Mehul Kumar Jan 03 '23 at 08:59
  • 2
    @MehulKumar Each individual e-mail will be delivered to one picked randomly. From [RFC5321](https://datatracker.ietf.org/doc/html/rfc5321#section-5.1): "_If there are multiple destinations with the same preference and there is no clear reason to favor one (e.g., by recognition of an easily reached address), then the sender-SMTP MUST randomize them to spread the load across multiple mail exchangers for a specific organization._" – jcaron Jan 03 '23 at 09:06
3

You can't split different e-mail addresses in the name domain to different e-mail providers just by the use of multiple MX records.

You can have multiple MX records, but they will apply for the whole domain, and mail will be randomly split between the servers those records point to.

Likewise, you could also have multiple A records for the names given by the MX records, but the result would be the same.

What you could do is point all traffic to one or more servers, and then have those servers transmit mail to other servers based on the destination address. For this:

  • You would need each of the "final" servers to be able to accept mail for that domain (at least for the intended e-mail addresses). I would expect quite a few providers to balk at doing so when the MX does not point to them, but YMMV.

  • You would need a server that can sort the mail and then redistribute it to the "right" server through some sort of manual configuration.

  • You would also need the final servers to be willing to accept mail from that intermediate server, which is is not listed as one of the permitted senders of for the origin domain. Unlikely with commercial providers (unless of course all e-mail you want to receive comes from a single domain you control).

So possible if you control all servers, quite unlikely if you want to use commercial providers.

The other alternative is to use mail forwarding. You will need different addresses/domains on the "destination" servers, and have the server(s) which are registered as MX for your domain forward the mail accordingly.

DNS:
example.com MX 1 my-mx.example.com

my-mx.example.com:
user1@example.com -> john_doe@example.org
user3@example.com -> jane.roe@example.net

Again, this may cause issues for mail origin verification (SPF/DKIM/DMARC...), careful configuration is on order.

Then there's the issue of sending e-mail from the "original" destination adresses.

An alternative is to use sub-domains. Instead of user1@example.com and user3@example.com you could use user1@hq.example.com and user3@lapland.example.com. Those can most definitely have different sets of MX records and different e-mail providers. In DNS/E-mail, subdomains are considered completely separate domains.

jcaron
  • 1,748
  • 12
  • 19
  • 1
    All the major cloud providers [can handle it](https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/manage-mail-flow-for-multiple-locations). Having a MX route to cloud is very common during staged migrations when you are moving accounts in batches. It's also common in universities, students may be on a free service, while staff and the hospital are on-prem or some paid service due to regulatory requirements. – user71659 Jan 02 '23 at 19:45
0

Actually no; This serverfault answer says so.

You can although add a different MX record for a subdomain, but not the same domain.

tabby.sl
  • 124
  • 8