Ahosting Logo
Knowledge Base

Understanding MX Records for Email

MX (Mail Exchanger) records specify which mail servers handle email for your domain. Without correct MX records, you cannot receive email.

How MX Records Work

  1. Someone sends email to [email protected]
  2. Sender's mail server looks up MX records for example.com
  3. MX record says: "Send mail to mail.example.com with priority 10"
  4. Sender delivers email to that mail server

MX Record Structure

example.com.    MX    10    mail.example.com.
  • example.com: The domain
  • MX: Record type
  • 10: Priority (lower = higher priority)
  • mail.example.com: Mail server hostname

MX Priority

Multiple MX records with different priorities provide backup:

example.com.    MX    10    mail.example.com.
example.com.    MX    20    backup.example.com.
  • Priority 10 is tried first (primary)
  • If unavailable, priority 20 is used (backup)
  • Lower number = higher priority

Adding MX Records in cPanel

  1. Go to Zone Editor
  2. Click Manage for your domain
  3. Click + MX Record
  4. Enter:
    • Priority: Number (e.g., 10)
    • Destination: Mail server hostname
    • TTL: Time to live
  5. Click Add Record

Ahosting Default MX Record

For email hosted with Ahosting:

Priority: 0
Destination: mail.yourdomain.com

Common Third-Party MX Records

Google Workspace

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

0    yourdomain-com.mail.protection.outlook.com

Zoho Mail

10   mx.zoho.com
20   mx2.zoho.com
50   mx3.zoho.com

Email Routing in cPanel

When using external email (Google, Microsoft):

  1. Go to Email > Email Routing
  2. Select your domain
  3. Choose Remote Mail Exchanger
  4. Click Change

This tells cPanel not to handle email locally.

MX Record Requirements

  • MX target must be a hostname, not an IP address
  • The hostname must have an A record
  • Cannot use CNAME as MX target
  • MX records are always for the root domain (not subdomains)

Troubleshooting MX Records

Not receiving email

  • Check MX records are correct
  • Verify mail server hostname has A record
  • Check email routing in cPanel
  • Wait for DNS propagation

Check MX records

nslookup -type=MX example.com
dig example.com MX

Online tools