Understanding MX Records for Hosting & Email Configuration
An MX (Mail Exchange) Record is a DNS record that directs email to the correct mail server for a domain. If MX records are incorrect or missing, email delivery will fail.
DNS Basics: MX records are part of your domain's DNS settings, not your web hosting control panel. They tell the world which server should receive email sent to addresses at your domain (e.g., user@yourdomain.com).
1. Check Your Current MX Records
Before making changes, check what MX records are currently configured for your domain.
Using dig (Linux/macOS)
dig MX yourdomain.com +short
Using nslookup (Windows/Linux/macOS)
nslookup -type=mx yourdomain.com
Using host (Linux/macOS)
host -t mx yourdomain.com
Understanding the Output
Expected Result:
10 mail.yourdomain.com
20 backupmail.yourdomain.com
- Priority Number: Lower numbers have higher priority (e.g., 10 is tried before 20).
- Mail Server: The hostname of the server that should receive email.
If no records are found or you see errors, emails will not be delivered and you need to configure MX records.
MX records are configured with your DNS provider (Cloudflare, cPanel DNS Zone Editor, Namecheap, GoDaddy, etc.).
Example MX Record Settings:
| Host/Name |
Type |
Priority/Preference |
Value/Target/Mail Server |
| @ (or yourdomain.com.) |
MX |
10 |
mail.yourdomain.com |
| @ (or yourdomain.com.) |
MX |
20 |
backupmail.yourdomain.com |
DNS Terminology Note: Different DNS providers use different labels:
- "Host" or "Name" =
@ or yourdomain.com. (note the trailing dot)
- "Priority" or "Preference" = Number (lower = higher priority)
- "Value" or "Target" or "Mail Server" = Hostname of mail server
3. MX Records for Specific Email Providers
Google Workspace (Gmail for Business)
Google Workspace MX Records
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.
Note the trailing dots - these indicate fully qualified domain names (FQDN). Some DNS interfaces add these automatically.
Microsoft 365 / Office 365
Microsoft 365 MX Records
0 yourdomain-com.mail.protection.outlook.com
Microsoft typically uses a single MX record with priority 0, pointing to their protection service.
Zoho Mail
Zoho Mail MX Records
10 mx.zoho.com
20 mx2.zoho.com
50 mx3.zoho.com
Important: Always refer to your email provider's latest documentation for MX record values, as they can change. Remove any old/existing MX records before adding new ones to avoid conflicts.
4. Ensure Mail Server is Configured Correctly
DNS records alone aren't enough - the mail server they point to must be properly configured to accept email for your domain.
For cPanel Hosting (Email on Same Server)
- Log into cPanel
- Navigate to Email > Email Routing
- Select "Local Mail Exchanger" if hosting email on the same server
- If using external email (Google, Zoho, Microsoft), select "Remote Mail Exchanger"
- Click "Change" to save
For DirectAdmin
- Log into DirectAdmin as Admin
- Go to Admin Panel > MX Records
- Add or modify MX records for your domain
- Save changes and restart mail services if prompted
For Plesk
- Log into Plesk
- Go to Domains > yourdomain.com > Mail Settings
- Configure mail service and MX records as needed
5. Test Email Delivery
After updating MX records, verification and testing are crucial.
Using Online Tools
Test with MXToolBox:
- Visit
https://mxtoolbox.com
- Enter your domain and select "MX Lookup"
- Review the results for any errors or warnings
Also test with:
Send Test Emails
- Send an email to your domain from an external account (Gmail, Yahoo, etc.)
- Send an email from your domain to an external account
- Check both sent and received messages for delivery issues
DNS Propagation: Changes to MX records can take 24-48 hours to propagate globally. Use DNS checking tools to verify propagation status in different parts of the world.
6. Troubleshooting Common MX Record Issues
| Issue |
Likely Cause |
Fix |
| Emails bouncing |
Incorrect or missing MX records |
Verify with dig MX yourdomain.com, correct records |
| Slow email delivery |
High MX priority numbers |
Set primary MX to lower number (e.g., 10 instead of 50) |
| Wrong email provider |
Using old provider's MX records |
Use correct MX values for current provider (Google, Zoho, etc.) |
| Emails going to spam |
Missing email authentication |
Set up SPF, DKIM, and DMARC records |
| Intermittent delivery |
DNS propagation incomplete |
Wait 24-48 hours, check propagation globally |
| Can receive but not send |
Outgoing (SMTP) server misconfigured |
Check SMTP settings, ports, authentication |
Proper MX record configuration is essential for reliable email delivery. Combined with SPF, DKIM, and DMARC records, it forms the foundation of a secure and functional email system for your domain!
Hosting with 99.95% uptime, reliable servers, and a 1 Gb/s network connection.
Generous disk space included in all plans.
Technical support 24/7/365.