MX Records: How Email Finds Your Mail Server
When someone sends mail to [email protected], their server looks up the MX records of example.com to find out where to deliver it. Get them wrong and mail bounces, goes to an old provider or disappears into a backup server nobody reads.
What an MX record says
An MX record pairs a priority with the hostname of a server that accepts mail for the domain. A domain usually has two or more.
example.com. — The domain that receives the mail. MX records sit on the domain itself, not on www or mail.
Point at, tap or tab to a part of the record to see what it does.
Priorities and backup servers
Senders sort the MX records by priority and try them in that order, moving on only when a server does not answer or refuses temporarily.
| Priority | Server | When it is used |
|---|---|---|
10 | mx1.example.com. | First choice for every sender. |
10 | mx2.example.com. | Same priority: senders pick between the two at random, which spreads the load. |
50 | backup.example.net. | Only when both servers above are unreachable. |
If every server is unreachable, the sending server keeps the message and retries for several days, so a short outage of your mail server does not lose mail. That is why a separate backup MX is rarely needed today.
Rules for the target
- The target must be a hostname.
10 203.0.113.25is invalid; createmail.example.comwith an A record and point the MX at it. - The target must not be a CNAME (RFC 2181 §10.3). Many servers tolerate it, some do not — it is a common reason for mail from one provider failing.
- The target must resolve. An MX pointing at a name without A or AAAA records is a dead end, and the DNS Health Score flags it.
- In zone files, end the hostname with a dot, or it will be read as
mail.example.com.example.com. - Keep exactly the records your provider gives you. Mixing two providers' MX records splits your incoming mail between them.
MX values of common providers
These are the published values at the time of writing. Your provider's admin console shows the authoritative ones for your account.
| Provider | MX records |
|---|---|
| Google Workspace | 1 smtp.google.com. |
| Microsoft 365 | 0 example-com.mail.protection.outlook.com. |
| Proton Mail | 10 mail.protonmail.ch. · 20 mailsec.protonmail.ch. |
| Fastmail | 10 in1-smtp.messagingengine.com. · 20 in2-smtp.messagingengine.com. |
| iCloud+ | 10 mx01.mail.icloud.com. · 10 mx02.mail.icloud.com. |
| Zoho Mail (EU) | 10 mx.zoho.eu. · 20 mx2.zoho.eu. · 50 mx3.zoho.eu. |
A domain that does not receive mail
Without MX records, senders fall back to the domain's A record and try to deliver there. To say clearly that a domain takes no mail, publish a Null MX (RFC 7505): a single MX with priority 0 and the target .. Pair it with an SPF and DMARC record that refuse all mail sent in the domain's name.
example.com. 3600 IN MX 0 .
example.com. 3600 IN TXT "v=spf1 -all"
_dmarc.example.com. 3600 IN TXT "v=DMARC1; p=reject;"This is worth doing for every parked or web-only domain: it stops senders from queueing mail for days, and stops spammers from using the domain as a sender.
MX is only half of email
MX records decide where mail arrives. Whether mail you send arrives depends on other records:
Checking MX records
Look the records up, then make sure every target resolves:
dig example.com MX +short
# 10 mx1.example.com.
# 20 mx2.example.com.
dig mx1.example.com A +short # every MX target needs an addressFrequently asked questions
Can an MX record point to an IP address?
No. The value must be a hostname. Create an A record such as mail.example.com and point the MX at that name.
What does the MX priority number mean?
Only the order matters: senders try the lowest number first. Records with the same number share the load.
How long does it take for an MX change to work?
Senders follow the old MX until its TTL expires in their resolver's cache. Lower the TTL a day before switching providers, then most mail moves within minutes.
Do I need an MX record if I do not use email on the domain?
Publish a Null MX (0 .) together with v=spf1 -all and a DMARC p=reject record. That tells senders not to try and stops spoofing.
See the theory in practice — run a MX Lookup for your own domain.
Updated October 13, 2026