Best Practices for MX Records and Mail Routing

Learn how MX records route incoming email, how MX priority works, and how to avoid common mail routing mistakes during setup or migration.

By CheckDomainHealth Editorial Team Reviewed by Dionis Ceban Updated Jun 28, 2026 8 min read Beginner

Introduction

MX records tell the internet which mail servers should receive email for a domain. If MX records are missing, incorrect or pointed to the wrong provider, inbound email can bounce, route to the wrong mailbox system or disappear into an old mail setup.

Mail routing becomes especially important when moving between hosting email, Google Workspace, Microsoft 365, Zoho, cPanel, Plesk or another email provider. A clean MX setup should point to the intended mail provider, use correct priorities and be verified after DNS changes.

Quick answer

Quick answer

MX records route incoming email for a domain. Each MX record points to a mail server hostname and has a priority number. Lower priority numbers are tried first. MX values should point to hostnames, not IP addresses, and should match the email provider currently handling mailboxes.

What are MX records?

MX stands for Mail Exchange. MX records tell sending mail servers where to deliver incoming email for a domain.

Example
example.com. 300 IN MX 10 mail.example.com.

This means incoming email for example.com should be delivered to mail.example.com with priority 10.

MX records control inbound mail routing. They do not by themselves authenticate outgoing email. SPF, DKIM and DMARC handle authentication.

MX priority

MX records use priority numbers to decide which mail server should be tried first. Lower numbers have higher priority.

Example
example.com. 300 IN MX 10 mx1.provider.com.
example.com. 300 IN MX 20 mx2.provider.com.

In this example, mail servers should try mx1.provider.com first. If it is unavailable, they may try mx2.provider.com.

Providers use different priority values. Always follow your email provider’s exact MX instructions.

MX hostnames

MX records should point to mail server hostnames, not directly to IP addresses.

Correct
example.com. 300 IN MX 10 mail.example.com.
Incorrect
example.com. 300 IN MX 10 192.0.2.10

The hostname used in an MX record should resolve to an A or AAAA record.

One active mail provider

A domain should usually route incoming mail to one intended mailbox provider. Problems happen when old MX records remain after a migration.

  • Google Workspace MX records mixed with cPanel MX records
  • Microsoft 365 MX records mixed with old hosting mail records
  • Zoho MX records mixed with previous provider records
  • Backup MX records pointing to a system that does not know the mailboxes

Only keep multiple MX records when they are part of the same provider’s documented setup or a planned backup mail architecture.

Why this matters

Why this matters

MX records matter because they decide where incoming email is delivered. If they point to the wrong host, email may bounce, go to an old provider, or never reach the intended mailbox. This is one of the fastest ways to break business email during DNS or hosting migration.

MX records also interact with SPF, DKIM and DMARC indirectly because mail routing and authentication must match the provider setup.

How to check MX

Use MX Lookup to see which mail servers currently receive email for the domain.

When checking MX records, review

These six checks help confirm mail routing is correct.

Mail provider

Confirm MX records match Google Workspace, Microsoft 365, Zoho, hosting mail or another intended provider.

Priority values

Check whether priorities match provider instructions.

Old records

Look for old hosting or previous mail provider records.

Hostname validity

Confirm each MX hostname resolves to valid A or AAAA records.

Mixed providers

Check whether records from multiple providers are unintentionally active.

Related authentication

Check SPF, DKIM and DMARC after confirming routing.

Check MX records now

Use MX Lookup to see which mail servers receive email for your domain.

Run MX Lookup →

Common problems

MX records point to the wrong provider

High

Incoming mail may route to an old hosting account or incorrect mail system.

Next step: Replace MX records with the values provided by the active email provider.

MX record uses an IP address

High

MX values should point to hostnames, not raw IP addresses.

Next step: Create a hostname with A/AAAA records and point MX to that hostname.

Old MX records remain after migration

High

Mail may route inconsistently or to an old provider after switching email services.

Next step: Remove old MX records unless the new provider explicitly requires them.

Priority values are wrong

Medium

Mail servers may try backup or secondary servers before the primary one.

Next step: Set priorities exactly as your email provider documents.

MX hostname does not resolve

High

The MX target has no valid A or AAAA record.

Next step: Fix the target hostname or use the correct provider MX value.

Mixed providers are active

Medium

MX records from several unrelated providers can cause unpredictable delivery.

Next step: Keep only the intended provider’s MX records.

Backup MX accepts mail but cannot deliver it

Medium

A backup MX may accept messages but fail to relay them correctly to the real mailbox provider.

Next step: Use backup MX only if it is correctly configured and tested.

DNS changed but mail still routes old way

Low

Resolvers may still have cached old MX records.

Next step: Wait for TTL expiry and test from multiple resolvers.

How to configure MX

  1. Step 1: Identify the active email provider

    Confirm whether mailboxes are hosted at Google Workspace, Microsoft 365, Zoho, cPanel, Plesk, hosting mail or another provider.

  2. Step 2: Copy official MX values

    Use the provider’s exact MX hostnames and priority values.

  3. Step 3: Remove old MX records

    Delete previous provider records unless they are intentionally part of the setup.

  4. Step 4: Publish MX records at the active DNS provider

    Make changes where the domain’s active nameservers point.

  5. Step 5: Verify MX hostnames resolve

    Check that every MX target has valid DNS records.

  6. Step 6: Test inbound delivery

    Send test messages from external providers and confirm they arrive in the intended mailbox.

  7. Step 7: Check SPF, DKIM and DMARC

    After mail routing is correct, verify authentication records for outgoing mail.

Migration checklist

Before changing MX

Prepare before switching mail routing.

New provider ready

Confirm the new mailbox provider is ready.

Mailboxes created

Create mailboxes or aliases before cutover.

Lower TTL

Lower DNS TTL if possible before migration.

Rollback copy

Copy current MX records for rollback.

Auth records ready

Prepare SPF, DKIM and DMARC records.

Avoid unrelated changes

Do not change unrelated DNS records at the same time.

After changing MX

Verify routing after the MX change.

Verify MX lookup

Confirm public DNS shows the new MX records.

External test mail

Send test email from outside the provider.

Aliases and forwards

Test aliases and forwarding rules.

Bounce messages

Check for delivery failures or bounces.

SPF, DKIM, DMARC

Verify authentication records still resolve.

Monitor delayed mail

Watch for mail delayed by DNS cache.

MX examples

Single mail server
example.com. 300 IN MX 10 mail.example.com.
Primary and backup
example.com. 300 IN MX 10 mx1.provider.com.
example.com. 300 IN MX 20 mx2.provider.com.
Wrong: MX points to IP
example.com. 300 IN MX 10 192.0.2.10
Check commands
dig example.com MX
dig +short example.com MX
dig mx1.provider.com A

These examples are illustrative. Use the exact MX records provided by your email provider.

MX vs SPF/DKIM/DMARC

MX records control where incoming email is delivered. SPF, DKIM and DMARC help authenticate outgoing email.

MX

Routes inbound mail to mailbox servers.

SPF

Lists servers allowed to send mail for the domain.

DKIM

Signs outgoing mail with a domain key.

DMARC

Checks SPF/DKIM alignment and applies policy.

Changing MX does not automatically fix SPF, DKIM or DMARC. After email migration, all mail-related DNS records should be reviewed.

Frequently asked questions

What do MX records do?

MX records tell sending mail servers where to deliver incoming email for a domain.

Should MX records point to an IP address?

No. MX records should point to hostnames, and those hostnames should resolve to A or AAAA records.

What does MX priority mean?

Lower priority numbers are tried first. Higher numbers are usually backup or secondary mail servers.

Can I use MX records from multiple providers?

Only if it is intentional and documented. Mixing unrelated providers can break or misroute email.

Do MX records affect outgoing email?

MX records mainly affect incoming email. SPF, DKIM and DMARC affect outgoing email authentication.

How long do MX changes take?

It depends on DNS TTL and resolver caching. Some changes appear quickly, while others may take longer.

Should I remove old MX records after migration?

Yes, unless your new provider specifically instructs you to keep them.

Use these free tools to verify your configuration after applying changes.

Browse all Email Authentication guides →

Need help applying this fix?

Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.

Get Help Run Domain Health Check

Was this guide helpful?

Your feedback helps us improve our guides for everyone.