What is an MX record?
An MX (mail exchanger) record names a server that accepts e-mail for a domain. A sending server looks up the MX records of the part after the @ and delivers to one of them.
Each MX record has a priority number. Senders try the lowest number first and move to higher numbers only when that server is unreachable.
How to read an MX record
In a zone file, the record looks like this:
example.com. 3600 IN MX 10 mail.example.com.
- The domain that receives mail.
- The TTL in seconds.
- The priority: lower is tried first. Equal numbers share the load.
- The host name of the mail server. It must have an A or AAAA record and must not be a CNAME.
From the command line
Look up MX records without this site.
On macOS and Linux, use dig:
dig example.com MX +short
On Windows, use nslookup:
nslookup -type=MX example.com
To skip caches, ask one of the domain’s nameservers directly: dig @ns1.example.net example.com MX. The “Its own nameservers” option on the result page does the same.
Questions and answers
What happens when a domain has no MX record?
Senders fall back to the domain's A or AAAA record and try to deliver there. If the domain should never receive mail, publish a null MX record (priority 0, target ".") so senders give up at once.
Can an MX record point to an IP address?
No. The target must be a host name. Create an A record for the mail server and point the MX record at that name.
How do I check that my MX setup is healthy?
Open the Health tab for your domain. It checks that every mail server resolves, is not a CNAME, and has reverse DNS.