What Is an MX Record?

MX records tell the internet which servers receive email for your domain. Learn MX priority, example setups for Gmail and Microsoft 365, and common mistakes.

Last updated July 11, 2026

An MX record (Mail Exchange record) tells the world which servers accept email for your domain. When someone sends a message to you@example.com, their mail server looks up the MX records of example.com and delivers the message to the listed host with the best priority.

What does an MX record look like?

NameTypePriorityValue
@MX1aspmx.l.google.com
@MX5alt1.aspmx.l.google.com
@MX10alt2.aspmx.l.google.com

That's a classic Google Workspace setup. Lower priority numbers are tried first; if the priority-1 server is down, senders fall back to 5, then 10. Equal priorities distribute load between servers.

Rules every MX record must follow

  • Point to a hostname, never an IP. The target must have its own A or AAAA record.
  • Never point to a CNAME. The standard requires the MX target to resolve directly to an address; a CNAME target causes deliverability problems with strict servers.
  • Set MX on the receiving name. Mail for you@example.com uses MX records on example.com (name @), not on www.

Common provider setups

  • Google Workspace: single record - smtp.google.com, priority 1 (current recommended setup).
  • Microsoft 365: yourdomain-com.mail.protection.outlook.com, priority 0.
  • Zoho / Fastmail / others: two or three hosts with rising priorities - copy them exactly from your provider's setup page.

All of these work out of the box on ice.domains free DNS hosting, which supports MX records with priorities on every zone.

MX records alone don't stop spam filters

MX handles inbound routing. For your outbound mail to reach inboxes, publish authentication records as TXT records: SPF (which servers may send for the domain), DKIM (cryptographic signature), and DMARC (policy for failures). Missing SPF/DKIM is the #1 reason mail from a correctly-MX'd domain still lands in spam.

Changing mail providers safely

  1. Create the new provider's mailboxes and verify the domain first.
  2. Lower the MX TTL to 300s a day in advance so the switch propagates fast.
  3. Replace the old MX records with the new ones in one edit - mixed old/new MX sets split your inbound mail between providers.

Frequently Asked Questions

The priority (preference) number orders mail servers: lower numbers are tried first. If the priority-10 server is unreachable, sending servers fall back to priority 20, and so on.

No. MX records must point to a hostname that has its own A or AAAA record. Pointing MX directly at an IP violates the standard and many mail servers will reject it.

Yes, for sending. MX records handle inbound mail; SPF, DKIM, and DMARC (all TXT records) authenticate outbound mail so it does not land in spam. All are supported in free DNS hosting.

Get free DNS hosting in minutes

Unlimited zones and records on a global anycast network. Works with domains registered anywhere. No credit card required.