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?
| Name | Type | Priority | Value |
|---|---|---|---|
@ | MX | 1 | aspmx.l.google.com |
@ | MX | 5 | alt1.aspmx.l.google.com |
@ | MX | 10 | alt2.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.comuses MX records onexample.com(name@), not onwww.
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
- Create the new provider's mailboxes and verify the domain first.
- Lower the MX TTL to 300s a day in advance so the switch propagates fast.
- Replace the old MX records with the new ones in one edit - mixed old/new MX sets split your inbound mail between providers.