When a user has email accounts hosted on different physical email servers, the routing of incoming email is controlled by MX (Mail Exchange) records in the DNS (Domain Name System). Here’s a detailed explanation of how this works and what happens in various scenarios:
How MX Records Route Email
- MX records are DNS entries that specify which mail servers are responsible for receiving email for a given domain (e.g., example.com)312.
- Each MX record has a priority value (lower numbers are higher priority). When someone sends an email to [email protected], the sending mail server queries DNS for the MX records of
example.com
31. - The sender’s mail server tries to deliver the message to the mail server with the lowest priority value first. If that server is unavailable, the next lowest is tried, and so on312.
- If multiple MX records share the same priority, delivery is typically distributed between them using a round-robin approach, but the email is never delivered to both servers simultaneously32.
Example MX Record Table
Domain | Record Type | Priority | Value (Mail Server) |
---|---|---|---|
example.com | MX | 10 | mailhost1.example.com |
example.com | MX | 20 | mailhost2.example.com |
Per-Address vs. Per-Domain Routing
- MX records are set at the domain (or subdomain) level, not per individual email address49.
- This means all email addresses at a domain (e.g., [email protected], [email protected]) are routed according to the same set of MX records.
- It is not possible to have one MX record for [email protected] and a different MX record for [email protected] at the DNS level. All addresses under the same domain use the same MX record set49.
What if the Same Address Exists on Multiple Servers?
- If you accidentally set up the same email address (e.g., [email protected]) on two different servers, and both servers are listed as MX records for the domain:
- Which server receives the email depends on the MX priority and server availability.
- If both servers have the same priority, email delivery is distributed between them (round-robin)32.
- If priorities differ, the server with the lower priority value receives all mail unless it is down, in which case the next is used321.
- DNS does not “know” which server has which mailbox; it simply routes based on MX record configuration. If both servers accept mail for [email protected], mail will be delivered to whichever server is selected by the MX logic43.
- This can cause inconsistent mailbox contents, as some emails will go to one server and others to the second, depending on which MX record was used at the time.
Key Points
- MX records are domain-wide, not per-user49.
- Priority determines delivery order; equal priority means round-robin distribution32.
- DNS does not inspect individual mailboxes; it only routes to servers based on MX records43.
- If the same address is set up on multiple servers, email delivery will be split or prioritized according to MX settings, potentially leading to mail being scattered between servers.
“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.”4
“If multiple MX records have the same MX level, a round-robin configuration will be used to determine which server is tried first. Email will not be sent to both email servers.”2
In summary, MX records cannot route mail to different servers based on the recipient address—they operate at the domain level. If the same address exists on multiple servers, DNS and SMTP will not coordinate between them; delivery will be determined solely by MX priority and availability, or round-robin if priorities are equal.
Leave a Reply