You move your company's mailboxes to a new provider on Friday evening. By Monday some colleagues receive mail in the new system, some still see it arriving in the old one, and a supplier says their messages bounce. Almost every problem like this comes down to one small set of DNS records: the MX records that tell the world where mail for your domain should go.
This guide explains how sending servers use MX records, what priority numbers really mean, a few edge cases that trip people up (no MX at all, null MX, MX pointing at an IP), and how to check and fix a domain's mail routing.
How a message finds its way
When someone sends mail to anna@example.com, their mail server does not care where example.com's website is hosted. It asks DNS for the MX records of example.com. Each MX record has two parts:
example.com. 3600 IN MX 10 mx1.mailhost.example.
example.com. 3600 IN MX 20 mx2.mailhost.example.
- The priority (also called preference): lower numbers are tried first.
- The exchange: a hostname, which the sender then resolves to IPv4 and IPv6 addresses.
The sender tries mx1 first. Only if it cannot connect, or gets a temporary error, does it move to mx2. Records with the same priority share the load; the sender picks among them. The actual numbers do not matter, only their order, so 10/20 and 1/5 behave the same.
Edge cases worth knowing
- No MX records. The standard allows senders to fall back to the domain's A or AAAA record. That address is usually a web server that does not accept mail, so messages queue and eventually bounce.
- Null MX. A single record
0 .(RFC 7505) says explicitly "this domain accepts no email". It is good practice for domains used only for websites, because senders give up immediately instead of retrying for days. - MX pointing at an IP address. Not allowed. The exchange must be a hostname with its own A/AAAA records.
- MX pointing at a CNAME. Also against the standard, and some senders refuse it.
Check a domain's mail servers
The MX Lookup resolves the MX records, the addresses behind them and the likely provider in one go.
- Open the MX Lookup and enter a domain such as
example.com. - Optionally choose the resolver (Cloudflare or Google) in the resolver menu.
- Click Find MX records.
- Read the findings list first. It reports how many mail servers were found, whether any host has no IP address, an MX pointing at an IP, a null MX, or the missing-MX fallback.
- Review the table: Priority, Mail server, IP addresses, Provider and TTL. The lowest-priority row is labelled as the primary.
- Use Copy MX list to paste the records into a ticket or migration checklist.
The Provider column is inferred from the hostnames, for example names ending in a Google or Microsoft domain. It is a hint, not proof, but it quickly shows if a domain still points at the old host after a migration.
Checking MX from the command line
dig +short MX example.com
nslookup -type=mx example.com
PowerShell: Resolve-DnsName example.com -Type MX. These show priorities and hostnames but not the IPs behind them; run a second query per host to confirm each one resolves. The command line is handy when you need to query a specific nameserver directly (dig @ns1.example.net MX example.com), which shows your zone's current content before any cache catches up.
Troubleshooting mail delivery with MX
Mail still arrives at the old provider after a migration
Senders cache MX answers for the record's TTL. If the TTL was one day, some senders keep delivering to the old servers for up to a day after the change. Lower the TTL a day or two before the migration, then switch. The DNS Propagation Checker compares what several public resolvers see right now.
"No address" in the IP column
The MX hostname does not resolve. This is usually a typo, or a hostname that was deleted when a server was retired. Every MX host must have an A or AAAA record, otherwise mail to it fails.
Mixed providers
Leftover MX records from an old provider, with a lower or equal priority, split your incoming mail between two systems. Remove all old records when you migrate; a hosted provider rarely wants a third-party backup MX.
Mail bounces with "domain not found"
If the lookup reports NXDOMAIN, the domain itself does not resolve. Check the registration and nameservers with the WHOIS Lookup; an expired domain is a surprisingly common cause.
Should you have a backup MX?
Large hosted mail services run anycast or clustered hosts, so one MX name is normal and the tool only notes it for information. For self-hosted mail a second MX can help, but it must accept mail only for your domain and apply the same spam filtering, or spammers will target it.
MX is only half of email
MX records decide where mail to you goes. Whether mail from you is trusted depends on SPF, DKIM and DMARC. Once inbound routing works, check outbound authentication with the SPF Record Checker, the DKIM Checker and the DMARC Checker. If you run your own outbound server, also confirm its reverse DNS.
Frequently asked questions
Does a lower MX priority number mean higher preference?
Yes. Senders try the lowest number first and fall back to higher numbers only when the preferred servers are unreachable.
Can I have MX records with the same priority?
Yes. Servers with equal priority share incoming mail, and the sender chooses among them. This is a common way to spread load.
What happens if my domain has no MX record?
Senders may try the domain's A or AAAA address instead. If that server does not accept mail, messages are delayed and eventually bounce.
What is a null MX record?
It is a single MX record with priority 0 and a target of .. It tells senders the domain never accepts email, so they fail quickly instead of retrying.
How long does an MX change take to work?
New lookups get the new record immediately, but senders that cached the old answer keep using it until its TTL expires. Plan migrations around the TTL.