MX Records & Email Routing
MX (Mail Exchange) records tell the internet which servers handle email for your domain. Without properly configured MX records, you can't receive email.
What Are MX Records?
MX records are DNS records that specify the mail servers responsible for receiving email on behalf of your domain. When someone sends an email to you@yourdomain.com, the sending server looks up your MX records to find where to deliver the message.
How It Works
- Someone sends email to
contact@example.com - The sending server queries DNS for MX records of
example.com - DNS returns the mail server addresses
- The email is delivered to the mail server with the highest priority
MX Record Priority
Each MX record has two parts: a priority number and a mail server hostname.
Example MX Records
10 mail1.example.com20 mail2.example.com30 mail3.example.com
Lower numbers = higher priority. In the example above:
mail1.example.com(priority 10) receives email first- If
mail1is unavailable, email goes tomail2(priority 20) mail3(priority 30) is the last fallback
This provides redundancyβif your primary mail server goes down, backup servers can still receive your email.
Common Email Provider MX Records
Google Workspace (Gmail)
| Priority | Mail Server |
|---|---|
| 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.com |
Microsoft 365 (Outlook)
| Priority | Mail Server |
|---|---|
| 0 | yourdomain-com.mail.protection.outlook.com |
Replace yourdomain-com with your domain (dots become dashes)
Zoho Mail
| Priority | Mail Server |
|---|---|
| 10 | mx.zoho.com |
| 20 | mx2.zoho.com |
| 50 | mx3.zoho.com |
Proton Mail
| Priority | Mail Server |
|---|---|
| 10 | mail.protonmail.ch |
| 20 | mailsec.protonmail.ch |
Setting Up MX Records
To configure email for your domain:
- Sign up with an email provider (Google Workspace, Microsoft 365, etc.)
- Get MX record details from your provider's setup guide
- Log into your DNS provider (where your nameservers point)
- Delete any existing MX records (if switching providers)
- Add the new MX records with correct priorities
- Wait for propagation (usually 15 minutes to a few hours)
- Verify setup in your email provider's admin console
Important
MX records must point to hostnames, not IP addresses. The mail server hostname must have its own A record.
MX Record TTL
The TTL (Time To Live) of your MX records affects how quickly changes propagate:
- Low TTL (300-600 seconds) - Changes propagate faster, good when migrating
- High TTL (3600+ seconds) - More caching, reduces DNS lookups
Before migrating email providers, lower your MX record TTL a day in advance so the switch happens faster.
Troubleshooting Email Delivery
If you're not receiving email, check these common issues:
- No MX records - Add MX records from your email provider
- Wrong mail server - Verify hostnames match your provider's documentation
- Propagation delay - Wait up to 48 hours after making changes
- SPF/DMARC issues - Misconfigured email authentication can cause delivery problems
- Firewall blocking - Ensure port 25 isn't blocked at the mail server
Related: Email Security Records
MX records tell where to deliver email, but you also need authentication records to prevent spoofing and improve deliverability:
- SPF - Specifies which servers can send email for your domain
- DKIM - Adds a digital signature to verify email authenticity
- DMARC - Tells receivers how to handle failed authentication
Check Your MX Records
Use DNSLens to view MX records and identify your email provider for any domain.
Lookup MX Records