What Is an MX Record? Mail Exchange Records Explained
MX records tell the internet where to deliver email for your domain. Get them wrong and email delivery fails completely. Here is everything you need to know.
What Is an MX Record? Mail Exchange Records Explained
An MX record (Mail Exchange record) is a DNS record that specifies which mail server is responsible for accepting email on behalf of your domain. When someone sends an email to [email protected], their email provider queries DNS for your domain's MX records to find out where to deliver the message.
Without MX records, email simply cannot be delivered to your domain.
How Email Routing Works
When someone sends you an email:
- The sender's mail server looks up the MX records for your domain via DNS.
- DNS returns a list of mail servers with priority values.
- The sender's server connects to the highest-priority mail server and delivers the message.
- If that server is unreachable, it tries the next one in priority order.
This happens in milliseconds and is completely invisible to the end user.
MX Priority Numbers
Every MX record includes a priority number (also called preference value). Lower numbers mean higher priority. Example:
| Record | Priority | Meaning |
|---|---|---|
| mail1.yourdomain.com | 10 | Try this first |
| mail2.yourdomain.com | 20 | Fall back to this |
If mail1 is unreachable, senders fall back to mail2. This redundancy keeps email flowing even during server issues.
Common MX Configurations
Google Workspace
ASPMX.L.GOOGLE.COM — priority 1 ALT1.ASPMX.L.GOOGLE.COM — priority 5 ALT2.ASPMX.L.GOOGLE.COM — priority 5 ALT3.ASPMX.L.GOOGLE.COM — priority 10 ALT4.ASPMX.L.GOOGLE.COM — priority 10
Microsoft 365
yourdomain-com.mail.protection.outlook.com — priority 0
Microsoft 365 typically uses a single MX record pointing to their Exchange Online Protection gateway.
Zoho Mail
mx.zoho.com — priority 10 mx2.zoho.com — priority 20 mx3.zoho.com — priority 50
How to Check Your MX Records
Using dig (Linux/macOS): dig MX yourdomain.com
Using nslookup (Windows): nslookup -type=MX yourdomain.com
Using ElasticDomain: Run a Full Domain Scan (250 credits) or DNS lookup. ElasticDomain queries resolvers at 8.8.8.8 and 1.1.1.1 and shows your complete DNS record set including all MX records, their priorities, and whether they resolve correctly.
What Happens When MX Records Are Missing or Wrong?
| Problem | Result |
|---|---|
| No MX records | Email bounces or cannot be delivered |
| Wrong MX hostname | Messages queue at sender, bounce after 5 days |
| Typo in record | Same as wrong hostname |
| MX pointing to a CNAME | Invalid per RFC 2181 — many servers refuse delivery |
| Leftover old MX records | Split delivery — some mail goes to old provider |
MX pointing to a CNAME is a common mistake. Always point MX records directly to A record hostnames, never to CNAMEs.
MX Records and Email Authentication
MX records handle delivery, but not authentication. For authentication you also need SPF, DKIM, and DMARC as TXT records. Even with perfect MX records, missing authentication causes emails to land in spam.
Monitoring MX Records
MX records can change accidentally during DNS migrations or registrar transfers. A changed MX record means lost email — often without any immediate obvious symptom.
ElasticDomain monitors DNS records continuously and alerts you the moment an MX record changes. Set up a DNS Change alert on any domain where email is business-critical.