Skip to content
ProfitTool
Back to all articles
Developer Tools
1 min read

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.com

Each 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

ProviderExample MX records
Google Workspaceaspmx.l.google.com (priority 1)
Microsoft 365domain-com.mail.protection.outlook.com (priority 0)
Fastmailin1-smtp.messagingengine.com (priority 10)
Self-hostedmail.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.

Tags:#mx record#dns#email#mail server

ProfitTool Team

Security & Dev

Written 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.