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

  1. Someone sends email to contact@example.com
  2. The sending server queries DNS for MX records of example.com
  3. DNS returns the mail server addresses
  4. 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.com
20 mail2.example.com
30 mail3.example.com

Lower numbers = higher priority. In the example above:

  • mail1.example.com (priority 10) receives email first
  • If mail1 is unavailable, email goes to mail2 (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)

PriorityMail Server
1aspmx.l.google.com
5alt1.aspmx.l.google.com
5alt2.aspmx.l.google.com
10alt3.aspmx.l.google.com
10alt4.aspmx.l.google.com

Microsoft 365 (Outlook)

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

Replace yourdomain-com with your domain (dots become dashes)

Zoho Mail

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

Proton Mail

PriorityMail Server
10mail.protonmail.ch
20mailsec.protonmail.ch

Setting Up MX Records

To configure email for your domain:

  1. Sign up with an email provider (Google Workspace, Microsoft 365, etc.)
  2. Get MX record details from your provider's setup guide
  3. Log into your DNS provider (where your nameservers point)
  4. Delete any existing MX records (if switching providers)
  5. Add the new MX records with correct priorities
  6. Wait for propagation (usually 15 minutes to a few hours)
  7. 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

Learn about SPF, DKIM, and DMARC β†’

Check Your MX Records

Use DNSLens to view MX records and identify your email provider for any domain.

Lookup MX Records