MX records explained: how email finds your inbox
MX records tell the internet where to deliver email for your domain. Learn how they work, what priority means, how to set them up for Google Workspace or Microsoft 365, and how to fix common mistakes.
Every email sent to you@yourdomain.com starts with one question: which server accepts mail for yourdomain.com? The answer is in your domain's MX records. Get them right and email arrives; get them wrong and it silently disappears.
What is an MX record?
An MX (mail exchanger) record is a DNS record that names the mail server responsible for receiving email for a domain. It has two parts:
- a priority (also called preference) — a number; lower means "try first";
- a host name — the mail server, for example
mx1.mailprovider.com.
A domain can have several MX records. That gives senders a backup if the first server does not answer.
How email uses MX records
When someone sends you an email, their mail server:
- takes the domain after the @ in your address;
- looks up its MX records in DNS;
- sorts them by priority and connects to the server with the lowest number;
- if that server does not respond, tries the next one, and so on;
- if there are no MX records at all, falls back to the domain's own A record — which usually is a web server that does not accept mail.
Records with the same priority share the load: senders pick between them.
Example MX records
What you publish depends on your email provider. Always copy the exact values from your provider's setup page; these examples show the shape.
Google Workspace (current single-record setup):
| Priority | Host |
|---|---|
| 1 | smtp.google.com |
Older Google setups use several records such as aspmx.l.google.com with priority 1 and alt1.aspmx.l.google.com with priority 5. Both work.
Microsoft 365:
| Priority | Host |
|---|---|
| 0 | yourdomain-com.mail.protection.outlook.com |
A single record is normal for these providers: the host name already points to a large, redundant system.
How to look up MX records
- Use an MX lookup tool: enter a domain to see its mail servers in priority order, their IP addresses and the provider behind them.
- On the command line:
nslookup -type=mx yourdomain.com(Windows, macOS, Linux) ordig mx yourdomain.com.
Common MX mistakes
- No MX record. Mail falls back to the website's server and is usually lost. Every domain that receives email needs MX records.
- Old records left behind after switching providers. Some senders keep delivering to the old server. Remove MX records you no longer use.
- MX pointing to an IP address. Not allowed — the target must be a host name. Create an A record like
mail.yourdomain.comand point the MX at it. - MX pointing to a CNAME. Also not allowed by the standard and handled inconsistently.
- Typos in the host name. A host that does not resolve means mail cannot be delivered at all.
- Expecting instant changes. Old records are cached for their TTL. Lower the TTL a day before a planned switch.
Domains that should not receive email
Some domains only send email, or are used just for a website. You can say so explicitly with a null MX record — priority 0 and host . (a single dot), defined in RFC 7505. Senders then know immediately not to try, instead of queuing mail for days.
MX records and sending
MX records control receiving, but they matter when you send too:
- bounces and replies to your campaigns come back to your domain;
- many spam filters check that the sending domain can receive mail;
- email verification checks the MX records of every recipient domain — an address at a domain with no mail servers can never receive email, which is why list verification flags it as invalid.
For sending, the records that matter most are SPF, DKIM and DMARC. You can check each with our free SPF, DKIM and DMARC checkers.
The bottom line
MX records are a few lines of DNS that decide whether you receive email at all. Use the exact values from your provider, remove old ones when you move, never point them at an IP address — and check them with an MX lookup after every change.
Put this into practice with InboxRoads
Verify your list, authenticate your domain and send campaigns from one place. Pay only for the credits you use.