Skip to content
AdminKit

What does MX record priority actually do, and what commonly goes wrong?

An MX record's priority (preference) number tells sending mail servers which mail host to try first: the lowest number goes first, higher numbers are fallbacks if lower-priority hosts are unreachable, and records sharing one priority form an equally ranked group a sender may try in any order. AdminKit's MX lookup tool shows each host's priority and whether it resolves.

By AdminKit team, Netbase JSC · Updated

Key takeaways

  • The MX “priority” field is called preference in RFC 1035, and the lowest number is tried first.
  • Records that share a preference form one group. RFC 5321 tells senders to pick among them at random, which spreads the load.
  • A backup MX really does receive mail. If it is badly set up, that mail goes missing during the outage it was meant to cover.
  • With no MX record, senders fall back to the domain’s A/AAAA address. A domain that never takes mail should publish a null MX (RFC 7505).

Which MX host gets tried first?

Every MX record published for a domain carries two pieces of information: a hostname (the mail server) and a priority number, which RFC 1035 formally calls the “preference” value. The rule is simple but counterintuitive to anyone used to “priority 1” meaning “most important” in everyday software: in DNS, lower preference numbers are tried first. A domain publishing 10 mail1.example.com and 20 mail2.example.com tells every sending mail server to attempt mail1 first, and only fall back to mail2 if mail1 is unreachable — not simultaneously, and not in reverse. AWS’s Route 53 documentation states the same rule in a working DNS provider’s own terms: “the server with the lowest value for the priority takes precedence.” AdminKit’s MX lookup tool shows both the priority and hostname for every MX record a domain publishes, plus a second round of A/AAAA lookups for each listed host, so you can see at a glance whether a correctly listed host actually resolves.

The numbers themselves carry no meaning beyond their order. 10 and 20 behave exactly like 1 and 2, or 5 and 500. Many providers use steps of 10 so that a host can be added in between later without renumbering the others. Here is what a typical two-host setup looks like in a zone file:

example.com.   3600  IN  MX  10  mail1.example.com.
example.com.   3600  IN  MX  20  mail2.example.com.
mail1.example.com.  3600  IN  A   192.0.2.10
mail2.example.com.  3600  IN  A   198.51.100.20

How does a sending server work through the list?

RFC 5321, the core SMTP specification, describes the process in section 5.1. Put simply, a sending server does this:

  1. Look up the MX records for the domain after the @. If the domain doesn’t exist at all, that is a hard error and the message bounces.
  2. Sort the hosts by preference, lowest first. Hosts with the same preference are shuffled at random.
  3. Resolve each host name to its addresses (A and AAAA). RFC 5321 requires that the MX target is a name that returns at least one address record. It cannot be an IP address or a CNAME.
  4. Try each address in order until one accepts the message. The RFC says a client should try at least two addresses before giving up on this round.
  5. Queue and retry if nothing accepts. RFC 5321 §4.5.4.1 says the retry interval should generally be at least 30 minutes, and the give-up time generally at least 4-5 days.

That last step is why a broken MX setup rarely bounces mail right away. A sender that can’t reach any host keeps the message and tries again later, so the problem shows up as mail arriving hours or days late before anyone sees a bounce.

Why do domains list more than one MX host?

Listing a primary host at a low priority and one or more backups at higher priorities is the standard way to build redundancy into mail delivery without needing a dedicated load balancer in front of the mail server itself. If the primary host is down, overloaded, or temporarily refusing connections, a well-behaved sending server retries against the next-highest-priority host rather than simply giving up and bouncing the message immediately. This is also why a backup MX host needs to be a real, working mail server for the domain — it genuinely gets used, just less often, and an organization that lets its backup rot (wrong configuration, expired certificate, no monitoring) can end up silently losing mail during exactly the outage the backup was supposed to cover for. Not every provider uses several MX hosts, though: Google Workspace’s MX setup guide now gives a single MX record value, smtp.google.com, and notes that older values starting with aspmx are still supported.

A backup host also needs the same filtering as the primary. If it accepts mail for the domain but skips the spam and recipient checks the primary does, senders of junk mail can aim at the backup on purpose. A backup MX should know which recipients exist, check sender authentication the same way, and pass mail on to the primary when it comes back.

What happens when two records share a priority?

Two or more MX records can legitimately share the identical priority number. When that happens, they form a single group with no preference between them. RFC 5321 §5.1 says that when “there is no clear reason to favor one”, the sender “MUST randomize them to spread the load across multiple mail exchangers”. This works as simple load balancing across the group rather than a strict primary/backup relationship. It’s a deliberate design, not an error state, and it’s common for organizations that run two or more mail servers behind the same priority specifically to spread load rather than to express a fallback order.

Published recordsHow senders treat themTypical use
10 a.example.com onlyEvery message goes to a; if it is down, mail is queued and retried.Small domain with one hosted mailbox provider.
10 a and 20 ba first; b only when a can’t be reached.Primary server plus a backup.
10 a and 10 bRandom choice between a and b on each delivery.Two equal servers sharing the load.
10 a, 10 b, 20 cRandom choice between a and b; c only when both fail.Load-shared pair with a backup behind it.
0 . (null MX)No delivery attempt; the sender reports a failure.A domain that never receives mail.

What happens with no MX record?

A domain is not strictly required to publish an MX record to receive mail. RFC 5321 section 5.1 says that when the MX lookup comes back empty, “the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host” — in other words, senders fall back to the domain’s own A or AAAA record. This was historically a convenience for very simple setups. In practice it is fragile: the A record of a typical domain points to a web server or a CDN that doesn’t accept mail on port 25, so senders end up queuing messages and retrying for days. A domain that genuinely wants to receive mail reliably should publish explicit MX records rather than depend on the fallback.

How should a domain say it never receives mail?

Plenty of domains — a marketing redirect, a domain parked for brand protection, a subdomain used only for static assets — never send or receive mail at all and should say so explicitly rather than leaving it ambiguous. RFC 7505, also tracked in the IETF Datatracker, standardizes exactly this case: a single MX record with the target hostname set to . (the DNS root), known as a “null MX.” It tells any sending server attempting to deliver mail to that domain, unambiguously, that no mail service exists there at all, rather than leaving the sender to guess from an absent MX record whether it should try the A/AAAA fallback. Domains that will never handle mail are increasingly expected to publish this record as part of baseline DNS hygiene.

The record is one line, with preference 0 and the root as its target:

parked-example.com.  3600  IN  MX  0  .

A null MX only covers receiving. If the same domain also never sends mail, pair it with an SPF record that authorizes nobody (v=spf1 -all) and a DMARC policy of p=reject, so receivers can turn away anything forged in the domain’s name. SPF, DKIM and DMARC explained covers what each of those records does. For the full record set for a parked domain, including subdomain wildcards and the empty DKIM key question, see how to stop email spoofing of a parked domain.

Which MX misconfigurations should you check for?

  • A backup MX host that no longer exists or no longer resolves — invisible until the primary fails, at which point mail silently has nowhere reliable to go.
  • MX records pointing at a bare IP address instead of a hostname — not valid per the DNS MX format, which requires a hostname that is then separately resolved to an IP.
  • An MX record pointing at a CNAME instead of a hostname with its own A/AAAA record — also invalid, per RFC 2181 this time rather than the MX format itself; see when an MX record points to a CNAME for why this specific setup happens and how different mail software reacts to it.
  • Forgetting that a resolving MX hostname isn’t the same as working mail delivery — confirm the host is actually accepting connections and correctly authenticating mail, covered in SPF, DKIM and DMARC explained, rather than stopping at “the DNS lookup succeeded.”
  • Leaving MX records in place on a domain that no longer sends or receives mail, instead of publishing an explicit null MX, which can leave the domain’s mail-handling intent genuinely ambiguous to senders and automated reputation systems alike.
  • Old MX records left behind after a provider move. If the old provider’s hosts stay listed, even at a higher number, some mail can still land in a mailbox nobody reads.

How do you check your own MX setup?

Run AdminKit’s MX lookup first to see exactly what’s currently published and whether each host resolves, then use the DNS lookup tool if you need to check any other record type the same mail infrastructure depends on. See how to read an MX lookup result for a walkthrough of the priority column and the host-resolution check together, as they appear in an actual result.

When you read the result, work through these checks in order:

CheckWhat a healthy result showsWhat a problem looks like
Lowest numberThe host you expect to take most mail has the lowest preference.A backup or a former provider has the lowest number.
Host resolutionEvery listed host returns at least one A or AAAA address.A host returns no address, or only a CNAME.
Target formatEvery target is a host name.A target is an IP address.
Equal-preference hostsHosts that share a number can all accept mail for the domain.One host in the group rejects or doesn’t answer.
LeftoversOnly the current provider’s hosts are listed.Hosts from a provider you left are still published.
Domains with no mailThe only answer is 0 . (null MX).No MX at all, so senders fall back to the web server’s address.

This guide is part of AdminKit’s email authentication cluster of SPF, DKIM, DMARC and mail-routing guides and tools.

This guide is general information, not a security audit of your specific network — see our disclaimer for what AdminKit's guidance does and does not commit to.

Frequently asked questions

Does a lower or higher MX priority number get tried first?

Lower. RFC 1035 defines the MX preference field as a plain ranking where lower values are preferred (§3.3.9), so a priority of 10 is tried before a priority of 20. This trips people up because it's the opposite of how 'priority 1' usually reads in everyday language, but the DNS field is officially called 'preference', and lower is always preferred.

What happens if two MX records have the same priority number?

They're treated as a single equally-ranked group. RFC 5321 §5.1 says that when several destinations share a preference and there is no clear reason to favor one, the sending server must randomize them to spread the load. Neither is favored over the other, so both hosts need to be equally capable of accepting mail for the domain.

A domain has no MX record at all — can it still receive mail?

Sometimes. RFC 5321 §5.1 says that when no MX record exists, a sender treats the domain's own A or AAAA address as an implicit MX with preference 0. That address often belongs to a web server that doesn't accept mail, so senders end up queuing and retrying instead of delivering. A domain that genuinely receives mail should publish explicit MX records rather than rely on this fallback.

What's a 'null MX' record and why would a domain want one?

A null MX is a specific, standardized record — a single MX record with the hostname set to '.' (the root) — that explicitly declares a domain accepts no mail at all (RFC 7505). It exists so domains that never send or receive email, such as a domain used only to host a website, can tell other mail servers not to bother trying, rather than leaving the absence of MX records ambiguous or vulnerable to a sending server's fallback behavior.

Does a resolving MX hostname guarantee mail will actually be delivered?

No. A resolving A/AAAA record for the MX host only confirms the host exists on the network — it says nothing about whether that host is actually running a mail server, accepting connections on port 25, or rejecting messages for its own reasons (full mailbox, authentication failure, content filtering, and so on). Confirming actual delivery needs a live SMTP test, not just a DNS lookup.

Want AdminKit to watch this for you?

Free checks tell you the state today. Protective DNS and monitoring tell you when it changes.

Huy Nguyen (David), Founder and CEO of Netbase JSC

Talk to an expert

Huy Nguyen (David), Founder & CEO, Netbase JSC

Ask whether this fix applies to your setup, or get a second pair of eyes on your DNS and mail records.