How to Read MX Records and Mail Priorities
A comprehensive guide to MX records. Learn how MX records work, how priority is calculated, how mail routing functions, and how to troubleshoot delivery issues.
Tools For This Topic
What is an MX record?
An MX (Mail Exchange) record is a DNS record that specifies which mail servers are responsible for receiving email on behalf of a domain.
When an email is sent to an address like user@example.com, the sending server queries DNS for MX records associated with the domain to determine where to deliver the message.
MX records are fundamental to email delivery and are used by platforms such as Microsoft 365 and Google Workspace.
For a deeper DNS-level explanation, Cloudflare provides a useful reference on how MX records work.
How MX records work in email delivery
When an email is sent, the sending server follows a structured lookup process:
- Extract the domain from the recipient address such as example.com
- Query DNS for MX records
- Sort results by priority with the lowest value first
- Attempt delivery to the highest priority server
- Fall back to lower priority servers if needed
This process ensures redundancy and reliability in email delivery.
What an MX record looks like
An MX record consists of a priority value and a target hostname.
10 mail.protection.outlook.comIn DNS zone format:
example.com. IN MX 10 mail.protection.outlook.com.The priority determines delivery order, while the hostname identifies the receiving mail server.
MX record priority explained
MX priority determines which server is used first. Lower numbers indicate higher priority.
Mail servers will always attempt delivery to the lowest value before trying higher ones.
- 0 is highest priority
- 10 is preferred over 20
- Multiple MX records provide failover
- Equal priorities can enable load balancing
MX target hostname explained
MX records must point to a hostname, not an IP address.
That hostname is then resolved using A or AAAA records.
For example, mail.protection.outlook.com resolves to multiple IPs globally, allowing providers to distribute traffic and maintain high availability.
Using hostnames instead of IPs allows providers to scale infrastructure without requiring DNS changes from customers.
Worked MX record example
Consider the following MX configuration:
0 mx1.examplemail.net
10 mx2.examplemail.net
20 mx3.backupmail.netDelivery flow:
- mx1.examplemail.net is attempted first
- If unavailable, mx2.examplemail.net is used
- mx3.backupmail.net acts as fallback
This layered approach provides resilience and redundancy.
Why MX records resolve to multiple IP addresses
MX records point to hostnames, which can resolve to multiple IP addresses.
This supports:
- Load balancing across servers
- High availability and failover
- Geographic routing
- Cloud-scale infrastructure
Seeing multiple IPs for a single MX record is expected behaviour.
Real-world MX record examples
Microsoft 365:
0 example-com.mail.protection.outlook.comGoogle Workspace:
1 aspmx.l.google.com
5 alt1.aspmx.l.google.com
5 alt2.aspmx.l.google.com
10 alt3.aspmx.l.google.com
10 alt4.aspmx.l.google.comCommon MX record checks
When troubleshooting delivery issues, check:
- MX records exist for the domain
- Priorities are correctly ordered
- MX hostnames resolve to valid IPs
- Records point to the correct provider
- No legacy records remain
- DNS propagation is complete
Common MX record mistakes
Misconfigurations are a common cause of email failure:
- Pointing MX to the wrong provider
- Leaving old MX records after migration
- Using IP addresses instead of hostnames
- Incorrect priority values
- Non-resolving hostnames
- Propagation not complete
MX records and email security
How to troubleshoot MX record issues
If email is not being received:
- Query MX records using tools like dig or nslookup
- Check propagation globally
- Confirm MX targets resolve correctly
- Test SMTP connectivity on port 25
- Check firewalls or filtering
- Verify provider configuration
- Review authentication records such as SPF, DKIM, and DMARC
You can also validate MX records quickly using DNS Pro.
Best practices for MX records
Follow these practices for reliable delivery:
- Use hostnames, never IP addresses
- Align MX records with your provider
- Use multiple records for redundancy
- Remove unused entries
- Monitor changes during migrations
- Regularly audit DNS and authentication setup
Use These DNS Pro Tools
If you want to validate this topic in practice, these DNS Pro tools are the fastest next step.
Related Tools
Related Articles
How to Troubleshoot MX Record Problems
A practical MX troubleshooting guide covering missing MX records, wrong targets, bad priorities, and how to verify mail routing during migrations.
What is a PTR record?
Learn what PTR records are, how reverse DNS works, and why accurate PTR validation matters for mail delivery, logging, and network trust.
What Is an A Record? DNS A Record Explained
Learn what an A record is, how it maps a hostname to an IPv4 address, where it is used, and how to troubleshoot common A record issues.
