What Is an MX Record? Email Routing Explained
MX (Mail Exchange) records are DNS entries that tell other mail servers where to deliver email for your domain. This guide explains how MX records work and how to configure them.
ProfitTool Team
Security & Dev
How Email Routing Works
When someone sends an email to user@example.com, their mail server needs to find where to deliver it. It performs a DNS lookup for the MX records of example.com to find the destination mail servers.
MX Record Format
example.com 3600 IN MX 10 mail.example.com
example.com 3600 IN MX 20 backup-mail.example.comEach MX record has two values:
- Priority: a lower number means higher priority (10 is tried before 20)
- Mail exchanger: the hostname of the mail server
The hostname in an MX record must itself have an A or AAAA record — you cannot point an MX record directly at an IP address.
Multiple MX Records and Failover
Multiple MX records with different priorities provide redundancy. If the primary server (priority 10) is unavailable, sending servers retry with the next lowest priority (20). This is how hosted email providers offer reliability.
Common MX Configurations
| Provider | Example MX records |
|---|---|
| Google Workspace | aspmx.l.google.com (priority 1) |
| Microsoft 365 | domain-com.mail.protection.outlook.com (priority 0) |
| Fastmail | in1-smtp.messagingengine.com (priority 10) |
| Self-hosted | mail.yourdomain.com (priority 10) |
MX Records and Email Authentication
Your MX records interact with SPF and DMARC. The mx mechanism in an SPF record authorises the mail servers listed in MX records to send email on behalf of your domain.
Check MX records for any domain with our DNS Lookup tool.
ProfitTool Team
Security & DevWritten and maintained by the ProfitTool team. Where an article references a ProfitTool utility, the behaviour described is the behaviour of the tool on this site — you can open it and check the output yourself.
More from the Knowledge Hub
How DNS Lookup Works: A and AAAA Records Explained
When you type a domain into a browser, DNS translates it to an IP address. This guide explains how DNS resolution works and the difference between A and AAAA records.
Developer ToolsWhat Is a CNAME Record in DNS? Rules, Limits & Examples
A CNAME record creates a DNS alias from one hostname to another. Learn how CNAMEs work, why they cannot sit at the apex, and how to verify one with dig.
Developer ToolsWhat Is a DNS SOA Record?
The Start of Authority (SOA) record is the first record in every DNS zone. It contains authoritative information about the zone including serial number, refresh intervals and responsible contact.