MX Records: How Email Finds Your Mail Server

Beginner⏱ 4 min readUpdated October 13, 2026

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.

MX prioritySender1020mail1.example.comMX 10mail2.example.comMX 20
The lowest number is tried first; the higher one takes over only when the first server does not answer.

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.

PriorityServerWhen it is used
10mx1.example.com.First choice for every sender.
10mx2.example.com.Same priority: senders pick between the two at random, which spreads the load.
50backup.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.

Watch out: A backup MX that is not configured to know your real mailboxes accepts everything, including spam to invented addresses, and then bounces it later — to forged senders. Spammers deliberately target the highest-numbered MX for that reason.

Rules for the target

  • The target must be a hostname. 10 203.0.113.25 is invalid; create mail.example.com with 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.

ProviderMX records
Google Workspace1 smtp.google.com.
Microsoft 3650 example-com.mail.protection.outlook.com.
Proton Mail10 mail.protonmail.ch. · 20 mailsec.protonmail.ch.
Fastmail10 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.
Note: Microsoft 365 builds the hostname from your domain (dots become dashes), so copy it from the admin centre rather than typing it.

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:

  • SPF lists the servers allowed to send for your domain.
  • DKIM signs outgoing mail with a key published in DNS.
  • DMARC tells receivers what to do when SPF and DKIM fail.
  • PTR on your sending server's IP must point back to a matching name.

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 address
0 of 6 done

Frequently 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.

Try it on your domain

See the theory in practice — run a MX Lookup for your own domain.