Technical 11 min read

MX Records Explained: How to Check Your Mail Exchange Records (and Why They Decide If Email Arrives)

Your MX records are the DNS signpost that tells the world where to deliver mail for your domain. Get them wrong and email silently fails. Here is exactly what an MX record is, how to read an MX lookup, what the priority numbers mean, and how to fix the misconfigurations that break delivery.

Key Takeaways
  • An MX (Mail Exchange) record is a DNS record that tells sending servers which mail server is responsible for receiving email for your domain.
  • Each MX record has a priority (preference) value from 0 to 65535, and the lowest number is tried first; higher numbers are backups used only when the primary is unreachable.
  • The MX exchange must be a hostname that resolves to an A or AAAA record; per RFC 5321 it must never point to a bare IP address or a CNAME.
  • A null MX, a single record of 0 followed by a dot (RFC 7505), explicitly declares that a domain accepts no email, so senders reject immediately instead of retrying for days.
  • MX controls who receives your mail, while SPF, DKIM, and DMARC control who may send it; these are separate concerns, and checking your MX with a lookup is the first diagnostic step when mail is not arriving.

When someone sends an email to your domain, the very first question their server asks is deceptively simple: where do I deliver this? The answer lives in your MX record, a small piece of DNS configuration that acts as the signpost pointing to your mail server. Get it right and mail flows invisibly; get it wrong, and email to your domain silently fails or bounces, often with no obvious cause. MX records are among the most important and most misunderstood pieces of email infrastructure, and they are also among the easiest to check once you know how.

This guide explains exactly what an MX record is, the anatomy of the record and what every field means, how the priority system works, how to run and read an MX lookup, the common misconfigurations that break delivery, and how MX fits into the broader picture of deliverability. Whether you are setting up a new domain, migrating email providers, or diagnosing why messages are not arriving, this is the record to understand first.

What an MX Record Actually Is

An MX record is a type of DNS record whose single job is to specify the mail server (or servers) responsible for accepting incoming email for a domain. When a sending server wants to deliver a message to someone at yourdomain.example, it queries DNS for the MX records of yourdomain.example, gets back the hostname of the responsible mail server, connects to it, and hands over the message. Without a valid MX record pointing to a working server, there is no address for inbound mail to go to.

Critically, the MX hostname does not have to match your domain. It is completely normal for a domain to have an MX record pointing to a provider's infrastructure, for example a Google Workspace domain whose MX points to a Google mail host. The MX record is a pointer, so it can point anywhere you host your mail. This is why the exchange hostname so often looks nothing like the domain itself, and that is expected, not a problem.

The inbound signpost
MX records tell sending servers where to deliver mail for your domain. A domain can receive email only if its MX records point to working, reachable servers, or it has no MX and a usable A or AAAA fallback.

The Anatomy of an MX Record

In DNS zone file format, an MX record looks like this:

brand.example.    3600    IN    MX    10    mx1.mail.brand.example.

Each field has a specific meaning:

  • Owner (brand.example.): the domain the record applies to. The trailing dot marks it as a fully qualified domain name.
  • TTL (3600): the time to live in seconds, how long resolvers may cache the record. MX TTLs are typically 300 to 3600 seconds, which matters when you change records because old values stay cached until the TTL expires.
  • Class (IN): the DNS class, essentially always IN for internet.
  • Type (MX): the record type.
  • Priority (10): the preference value, a 16-bit unsigned integer from 0 to 65535. Lower is tried first.
  • Exchange (mx1.mail.brand.example.): the hostname of the mail server. This must resolve to an A record (or AAAA for IPv6). Per RFC 5321 it must not be a bare IP address and must not point to a CNAME.

That last rule trips people up constantly: the exchange has to be a hostname that itself resolves to an IP via an A or AAAA record, never an IP directly and never a CNAME alias. An MX pointing at a CNAME or an IP is a misconfiguration even if it sometimes appears to work.

How the Priority System Works

The priority (also called preference) number is the part most people misread, because the logic is inverted from what intuition suggests: a lower number means higher priority. Sending servers always try the lowest-numbered MX first, and only fall back to higher-numbered records if the lower one is unreachable.

PriorityExchangeRole
10mx1.mail.brand.examplePrimary; tried first
20mx2.mail.brand.exampleBackup; used only if the primary is down

So in the example above, every message is delivered to the priority-10 server first. The priority-20 server receives mail only when the priority-10 host is unreachable. Backup servers conventionally use higher values such as 20 or 50. If two records share the same priority value, senders distribute delivery attempts across those hosts, which is one way to balance load across multiple equivalent servers. The actual numbers do not matter in absolute terms, only their relative order; 10 and 20 behave identically to 5 and 500.

Lower number, higher priority: the rule to tattoo on your brain. The single most common MX misunderstanding is assuming a bigger priority number means a more important server. It is the reverse. Priority 10 is tried before priority 20. If you want a specific server to be your primary, give it the lowest number. When you set up a backup server, give it a higher number so it only catches mail when your primary is down. Reading the numbers backwards is how people accidentally route all their mail to a backup server that lacks their full spam and policy controls.

How to Check Your MX Records

Checking your MX records takes seconds, and you should do it whenever you set up a domain, change email providers, or suspect a delivery problem. There are three common ways:

  1. A dedicated MX lookup tool. The fastest route for most people is an MX lookup tool, which queries your records and presents the priorities and exchange hostnames clearly, often alongside related checks. This is the easiest way to confirm your records at a glance.
  2. The dig command. On macOS or Linux, run a simple query:
    dig +short mx brand.example
    This returns each record as its priority followed by the exchange hostname, with a trailing dot marking the fully qualified name.
  3. The nslookup command. On Windows (or anywhere), nslookup with the MX query type returns the same information in a slightly different format.

When you read the results, confirm three things: that the records exist at all, that the priorities are in the order you intend (lowest = primary), and that the exchange hostnames are correct and current for your provider. If you just changed records, remember that cached TTLs mean old values may persist until they expire, so wait out the TTL before concluding a change did not take.

No MX, Null MX, and Backup MX

Three special situations are worth understanding because each has real consequences.

No MX record (implicit fallback)

If a domain has no MX record at all, RFC 5321 says compliant senders fall back to the domain's A or AAAA record as an implicit MX, attempting delivery to whatever that address points to. This sometimes works, but you should never rely on it for a real business domain, because it is fragile and assumes your web server is also prepared to receive mail. Publish explicit MX records.

Null MX (the domain accepts no mail)

A null MX is a single record consisting of priority 0 and a lone dot (RFC 7505). It is a deliberate declaration that the domain accepts no email, and it is useful for domains you only send from or do not use for mail at all, because senders see it and reject immediately rather than retrying for days. The crucial warning: never publish a null MX on a domain that is supposed to receive mail, because it tells the world your domain is intentionally unreachable.

Backup MX (usually unnecessary now)

Backup MX records made sense when organizations ran their own mail servers and wanted a secondary to catch mail during outages. With modern hosted email, they are usually unnecessary, and they create real risk: long backup lists often contain forgotten hostnames pointing at unmaintained servers, and a backup host that lacks your full spam, malware, TLS, and policy controls becomes a weaker inbound path that attackers can target. If you use a hosted provider, you generally do not need backup MX records.

Common MX Misconfigurations That Break Mail

Most MX problems come down to a short list of recurring mistakes. When mail is not arriving, check for these:

  • Stale records from a previous provider. After migrating email, old MX records left pointing at the former provider route mail to the wrong place. Remove them.
  • MX pointing at an IP or a CNAME. The exchange must be a hostname that resolves to an A or AAAA record, never a bare IP and never a CNAME, per RFC 5321.
  • Forgotten backup MX hosts. Unmanaged secondary servers that no longer have proper controls create a weak, exploitable inbound path.
  • Relying on the A-record fallback. No MX at all leaves delivery to the implicit fallback, which is unreliable for business mail.
  • A null MX on a sending domain. Publishing 0 followed by a dot on a domain that should receive mail makes it look intentionally unreachable.
Pro Tip

Make an MX lookup the very first check when email to your domain stops arriving, before you touch anything else. Mail that silently fails to arrive feels mysterious, but the cause is often sitting plainly in your MX records: a stale entry from an old provider, a typo in an exchange hostname, or a record that was accidentally deleted. Running a quick MX lookup tells you in seconds whether your records even exist and point to the right server, which rules in or out the single most common cause of inbound delivery failure. Only after you have confirmed the MX is correct should you move on to investigating the mail server, authentication, or filtering. Check the signpost before you search the whole road.

MX, Verification, and Deliverability

It is important to be precise about what MX does and does not control, because conflating it with authentication causes confusion. MX controls where inbound mail is delivered. SPF, DKIM, and DMARC control who may send mail on behalf of your domain. These are entirely separate concerns: your MX records have nothing to do with whether your outbound mail passes authentication, and your authentication records have nothing to do with whether you can receive mail.

That said, MX records do matter for the sending side in one important way: email verification. When a verification system or a sending server checks whether an address is deliverable, one of its first steps is to look up the recipient domain's MX records, because a domain with no valid MX (and no usable fallback) cannot accept mail, so any address there is undeliverable. A missing or broken MX is therefore both a reason your domain cannot receive mail and a signal to the rest of the world that addresses at your domain will bounce. Keeping your MX records correct is foundational to both receiving mail reliably and being seen as a legitimate, deliverable domain. For the wider context, see our guidance on improving email deliverability.

The Bottom Line

MX records are the signpost that tells the internet where to deliver mail for your domain, and understanding them removes a whole category of mysterious email failures. The record points to a mail server by hostname (never an IP or CNAME), the priority number works backwards so the lowest value is your primary, no MX falls back unreliably to your A record, a null MX declares you accept no mail, and backup MX is usually unnecessary baggage now. Check your records in seconds with an MX lookup whenever you set up a domain, change providers, or chase a delivery problem, and keep them current and correct. Get the MX right, keep it separate in your mind from authentication, and you have solved the first and most fundamental question every piece of inbound mail asks of your domain.

Frequently Asked Questions

An MX (Mail Exchange) record is a DNS record that tells sending servers which mail server is responsible for receiving email for your domain. When someone emails your domain, their server looks up your MX record, finds the hostname of your mail server, connects to it, and delivers the message. The MX hostname does not have to match your domain; it commonly points to your email provider's infrastructure. Without a valid MX record pointing to a working server, your domain cannot receive email.

Priority (also called preference) is a number from 0 to 65535 on each MX record, and lower numbers are tried first. So a priority-10 server is used before a priority-20 server; the higher-numbered record is a backup reached only when the primary is unreachable. The logic is inverted from intuition: a lower number means higher priority. If two records share the same priority, senders distribute delivery across those hosts. Only the relative order matters, so 10 and 20 behave the same as 5 and 500.

Use an MX lookup tool for the fastest, clearest result, or run a command yourself: on macOS or Linux, dig +short mx yourdomain returns each record as its priority followed by the exchange hostname; on Windows, nslookup with the MX query type does the same. Confirm three things: that the records exist, that the priorities are ordered as you intend with the lowest as primary, and that the exchange hostnames are correct for your provider. If you just changed records, wait for the cached TTL to expire before retesting.

No. Per RFC 5321, the MX exchange must be a hostname that resolves to an A or AAAA record, and it must not be a bare IP address and must not point to a CNAME. An MX record pointing directly at an IP or at a CNAME alias is a misconfiguration, even if it sometimes appears to work. The correct setup is an MX record whose exchange is a proper hostname (such as mx1.mail.yourdomain), and that hostname has its own A or AAAA record resolving to the server's IP address.

A null MX is a single MX record consisting of priority 0 and a lone dot, defined in RFC 7505, and it declares that a domain accepts no email at all. It is useful for domains you only send from or do not use for mail, because senders see it and reject immediately rather than retrying failed delivery for days. The important warning is never to publish a null MX on a domain that is supposed to receive mail, because it tells every sender your domain is intentionally unreachable and will reject their messages.

Share this article:
← Back to Blog