DNS record types
What is a MX record?
An MX record says which servers accept mail for a domain, and in what order senders should try them.
When a server sends mail to you@example.com, it looks up the MX records for example.com and connects to the host with the lowest preference number. If that host does not answer, it tries the next one up.
A lower number means higher priority, which reads backwards to most people. 10 mail.example.com is tried before 20 backup.example.com.
An MX record must point at a hostname, never at an IP address. Pointing it at an IP is invalid and many senders will refuse the domain outright.
The fields
- Preference
- A number from 0 to 65535. Lower is tried first. Equal numbers are load-balanced between.
- Exchange
- The hostname of the mail server. It must resolve to an address, and it must not be a CNAME.
Example
example.com. 3600 IN MX 10 mail.example.com. example.com. 3600 IN MX 20 backup.example.com.
The mistake people make
A domain with no MX record does not silently fall back to its A record in most modern setups, and a domain that genuinely sends no mail should publish a null MX — a single record reading 0 .. That tells senders to reject immediately instead of retrying for five days.
Check the MX records on a real domain, with everything else that can quietly break.
Check a domain