What Is an MX Record? A Complete Guide
If you’ve ever set up email for a domain — Google Workspace, Microsoft 365, or a self-hosted mail server — you’ve had to add an MX record. Here’s what it actually does.
The short version
An MX (Mail Exchanger) record is a DNS record that tells the internet which server is responsible for accepting email sent to addresses at your domain. When someone sends mail to you@yourdomain.com, the sending server doesn’t guess where to deliver it — it looks up your domain’s MX records first.
What an MX record looks like
A typical MX record has three parts: the domain, a priority number, and a mail server hostname.
yourdomain.com. 3600 IN MX 10 mail.yourdomain.com.
Broken down:
- yourdomain.com. — the domain the record applies to
- 3600 — the TTL (time to live), in seconds, before resolvers should re-check the record
- MX — the record type
- 10 — the priority (also called “preference”)
- mail.yourdomain.com. — the hostname of the mail server
How priority actually works
This trips people up constantly: lower priority numbers are preferred. A record with priority 10 is tried before one with priority 20.
yourdomain.com. MX 10 mail1.yourdomain.com.
yourdomain.com. MX 20 mail2.yourdomain.com.
Here, mail1 is the primary — sending servers try it first. If it’s unreachable, they fall back to mail2. This is how mail systems build in redundancy without any special configuration on the sending side; it’s purely a function of how MX priority is defined.
If two records share the same priority, sending servers are free to pick between them (often randomly, or round-robin), which is a simple way to spread load across multiple servers.
Why MX records point to hostnames, not IP addresses
An MX record’s value must be a hostname (like mail.yourdomain.com), never a raw IP address. That hostname then needs its own A (or AAAA) record pointing to an actual IP. This indirection means you can change your mail server’s IP address without touching the MX record itself — you just update the A record.
Common real-world MX setups
Google Workspace domains typically use a single MX record:
yourdomain.com. MX 1 smtp.google.com.
(Older Google Workspace setups sometimes still show five aspmx.l.google.com records with priorities 1, 5, 10, 10, 10 — both are valid depending on when the domain was set up.)
Microsoft 365 domains typically look like:
yourdomain.com. MX 0 yourdomain-com.mail.protection.outlook.com.
Checking your own MX records
You don’t need command-line tools to check this — use the free MX Lookup tool to see a domain’s MX records and priorities in your browser. For a step-by-step walkthrough of interpreting the results, see How to Check MX Records.
If you’re configuring outbound mail infrastructure alongside your MX setup — for example, warming up a new sending domain or mailbox before running cold email or sales outreach — MailPilot can help warm up mailboxes and monitor deliverability once your DNS is in place.