Lower MX priority values are tried first, so a record with value 10 is attempted before one with value 20, and that number sets the order of attempts, not a guarantee that the first server will take the message. The value is a rank. It doesn't measure speed, it doesn't certify that a host is healthy, and it can't force a sender to use the server you prefer.
The advice you'll find everywhere says to put your main mail server at 10, your backup at 20, and move on. That advice is where a lot of delivery trouble starts, because it treats the number as a routing rule that guarantees your primary takes every message. The sender is really just walking an ordered list and stopping wherever a connection succeeds.
Once MX record priority reads as queue order, the question changes. You stop hunting for the "correct" number and start asking which host each number points to and whether that host accepts mail for your domain. The pattern you choose does far more work than the digits themselves.
Table of Contents
ToggleTable of Contents
- MX Priority Patterns and Sender Behavior
- What the Priority Number Actually Controls
- Check Your Current MX Records First
- Setting and Migrating MX Priorities Step by Step
- Common MX Priority Setups With Examples
- Address Records and Authentication Around MX Priority
- Troubleshooting Priority Problems by Symptom
- Test Your MX Order Before Going Live
MX Priority Patterns and Sender Behavior
A sending server sorts your MX records numerically and tries the lowest value first, so a record at 10 gets the first attempt and a record at 20 waits until that attempt fails. The preference value is an unsigned 16-bit integer attached to each mail-exchanger hostname, and it works as an ordering signal rather than a quality score, a latency measurement, or a guarantee that the first server receives every message, as the RFC 974 mail routing standard describes.
Four patterns cover almost every domain you'll audit. What separates them isn't the digits but what the sending server does after that first connection attempt.
| Record set | What the sender does | Owner should verify |
|---|---|---|
| One MX record (10) | Tries that single host only, with no fallback if it fails | Host accepts mail for the domain and resolves to an address |
| Distinct values (10 and 20) | Tries 10 first and moves to 20 only if attempts fail | The 20 host is a genuine failover system with capacity |
| Equal values (10 and 10) | Chooses between them in random order to spread load | Both hosts are equivalent and independently reachable |
| Mixed set (10, 10 and 30) | Uses both 10 hosts first, then 30 as the last resort | The 30 host is an intentional backup, not a forgotten old server |
What each pattern actually does
A single record is the simplest thing you can publish and the least forgiving. One host, one name, one address. If it's down, or its address record is broken, every sender has nowhere else to go and the message queues on their side until they give up.
Distinct values create ordered fallback. The sender commits to the lowest number, and only when connection attempts fail does it move to the next value up. That means the backup sits idle until something breaks, which is what you want from a standby and not what you want from a load-sharing front end.
Equal values flip the relationship. A sender that finds several records sharing the same preference picks between them at random to spread the work, and RFC 5321 requires that randomization when there's no other reason to favor one address, as the SMTP specification states. The hosts become peers, not a ranked pair.
The mixed set is the one people get wrong most often. Two hosts at 10 carry normal traffic, and a third at 30 sits behind them as the last resort. If that 30 host is an old server nobody has touched in a year, you've built a silent failure path, because the sender will happily hand it mail the moment both front ends stop answering.
Two designs that hold up
The first design puts three independent front-end servers at the same value. All three advertise the same equal preference, each one resolves to its own address, and each one accepts mail for the domain on its own. Senders spread inbound load across the three, and losing one costs you a third of your capacity instead of all of it. The hosts have to be equivalent, though. Different spam filtering, different mailbox rules, or one host that only knows a subset of your domains will show up as inconsistent delivery.
The second design is a primary at 10 and a standby datacenter at 20. Normal traffic lands on the primary, and the standby receives mail only while the primary is unreachable. Most providers hand you this shape by default, and it's the right one when the second site is a true disaster target rather than a peer.
Practical rule: identical values only for front ends that are truly equivalent and independently reachable; higher values only for systems you intend as failover.
A detail that trips people up is that neither design lets you pick which host a specific message lands on. Priority sets the attempt order, and the rest is sender behavior. A sender working from an older cached answer, or one that randomizes among equal values, makes its own choice.
If you'd rather watch the sort order in motion first, this walkthrough covers the mechanism.
Why DNS response order isn't load balancing
Your resolver returns records in some order, and that order means nothing to delivery. When several records share a preference value, the choice among them is governed by the sending server, and implementations vary in how they make it. Treating the DNS response order as a traffic split is a guess that happens to look stable until a different sender shows up with different logic.
The same rule explains why a "backup" that receives a few percent of traffic isn't broken. Some senders randomize among equal values, some retry on schedules you can't see, and some reach a host whose address resolves fastest on their network. If you need strict order, use distinct values and accept that the higher number only gets used during a failure.
None of this makes 0, 10, or 20 mean anything on their own. Providers publish their own schemes, and the numbers in one provider's documentation have no universal semantics. A provider that starts at 0 is expressing first preference in its own system; a provider that starts at 1 or 5 is doing the same thing with different digits. The documented values from your provider govern, and the ordering behavior from RFC 974, carried into RFC 5321, is what runs the sort.
What the Priority Number Actually Controls
The MX preference is a number attached to each mail-exchanger hostname, and a sending server sorts those numbers from lowest to highest before it makes its first connection. That's the whole control surface. Everything the number does, it does through order.
The model dates to 1986, when the MX record system was formalized in RFC 974 under the title "Mail Routing and the Domain System." It established that a domain's DNS data could name one or more mail exchangers responsible for accepting mail, which replaced a reliance on fixed hostnames and let organizations change servers or providers without rewriting how the internet reached them. The same model was folded into RFC 2821 in 2001 and RFC 5321 in 2008, the latter still the principal reference for SMTP delivery behavior.
Walk through a lookup. A sender asks for the MX records of a domain and gets two, a host called mail1 at value 10 and a host called mail2 at value 20.
- The sender orders them by value, so mail1 comes first.
- It resolves mail1 to an address and opens a connection.
- If that connection fails, it moves to mail2 and tries again.
The number never told the sender that mail1 was healthy, fast, or even configured for the domain. It only told the sender to try mail1 first.
There's a second step hiding in that sequence. The MX record holds a hostname, not an address, so the sender has to resolve that hostname before delivery can begin. A domain can publish a perfectly ordered MX set and still fail because the hostname behind the lowest value has no usable address. The priority is correct; the host isn't reachable.
That's the working mental model. Priority is queue order, not a promise of delivery, and it only means something when you check the hosts standing behind each number.
Check Your Current MX Records First
Read what the domain publishes today before you touch anything, because every decision about MX records priority depends on the current values. You can't choose a new order until you know the old one.
Query the MX set with a lookup tool or a DNS query, or use an MX record lookup explained tool that shows every record in one view. A typical answer lists a preference value and an exchange hostname for each entry, and you read the lowest value first because that host gets the first attempt.
Three things matter in every answer. The preference value tells you the order. The exchange hostname tells you which system is meant to receive mail. And whether that hostname resolves to an address tells you if the record can deliver.
- Empty address answer: the MX target has no A or AAAA record, and mail to it fails even though the priority is right.
- An IP address in the MX answer: the record is invalid and must point to a hostname that has an address record.
- A long TTL: resolvers may keep serving the old answer, so a TTL of 3600 can hold for up to an hour after your edit.
Ask two different resolvers for the same records and confirm they agree. Then write every value, target, and TTL into a table before editing anything, and keep that snapshot in the migration plan so rollback is one paste away.
Setting and Migrating MX Priorities Step by Step
Priority changes fail on process, not on the number. The value you pick is the easy part. The hard part is keeping mail flowing while resolvers and senders catch up to the edit, and that's where a written sequence earns its keep.
Microsoft's guidance on email authentication and DNS for Azure Communication Services makes the plain point that DNS must hold current MX information and that outdated records cause delivery failures. The deeper problem is timing. Removing a provider's record before the world has stopped using it creates a gap that no priority value can close.
- Inventory every mail host and label it. Primary, equal front end, or failover. The label decides the number, so write it down before you touch DNS.
- Confirm each target is a hostname, not an IP. It also needs a working A or AAAA record. An MX pointing at a raw address is invalid and will bounce.
- Confirm each host accepts mail for every recipient domain it serves. A host that resolves but refuses a recipient produces temporary failures that look like a priority problem.
- Assign values with room to move. Two equal front ends at 10 and a failover at 20, or 10, 20, 30 so you can insert a host later without renumbering the set.
- Lower the TTL well before the change. A long TTL keeps resolvers serving the old answer for up to that duration, so shorten it a day or more ahead and let the shorter value propagate first.
- Keep the old host accepting mail through the overlap. Publish the new set, then wait for the old TTL plus a safety margin. During this window some senders use the new provider while others still use cached records, so mail arrives at both systems. That split is expected, not a failure, and it ends when the cache does.
- Test each host directly, then test the fallback. Send a message to each host by name, then simulate a primary failure and confirm delivery lands on the next value.
- Watch logs for at least two weeks. Some senders retry on slower schedules than others, so a full picture takes longer than a single morning.
- Check SPF, DKIM, and DMARC separately. A clean inbound move can still break authentication, and the failure looks nothing like an MX issue.
- Retire the old host only after logs go quiet. If mail is still arriving there, something is still pointed at it.
The infographic below walks the same sequence as a flow.
A worked migration
Say a team moves from an on-premises server to a hosted provider. The new provider goes in at 5 and the old server drops to 10 for two weeks. Any sender working from cached records still delivers to the old host, and any sender that has picked up the new set goes to the provider. When the two weeks pass and the logs show the old server receiving nothing, the old record comes out and the new one is the only path left.
Why the overlap matters more than the numbers
Authentication and inbound routing are separate systems. The MX record names the servers that receive mail, but it doesn't authenticate outbound messages or build sender reputation. Teams that move inbound mail and leave SPF, DKIM, DMARC, forwarding, or TLS assumptions untouched tend to blame priority for failures that have nothing to do with it. Set up pairing MX records with DMARC correctly on the sending side before you attribute anything to the order.
A valid MX record can also point somewhere useless. Technically correct, lower than everything else, and the target isn't configured for the recipient domain, so it answers with temporary failures. That's why every step above ends with a real test message rather than a DNS check.
Common MX Priority Setups With Examples
Four record sets cover nearly every domain you'll visit. Each one below uses placeholder hostnames so you can drop in your own; the numbers are just the ones that keep the logic readable.
One host, one path
example.com. MX 10 mail.example.com.
The sender tries mail.example.com and, if it fails, has nowhere else to go. Simple, cheap, and a single point of failure. The mistake here is assuming your provider's redundancy is covered. If they manage failover behind one hostname, that's fine; if they don't, an outage stops inbound mail. Check it by sending a test and reading the receiving headers to confirm which host took it.
Primary and standby
example.com. MX 10 mx1.example.com.example.com. MX 20 mx2.example.com.
The sender commits to mx1 and only moves to mx2 when attempts fail. The common mistake is a backup that doesn't accept mail for every recipient the primary does, so it only delivers part of the domain. Check it by sending to several different addresses, not just one, and confirm the backup takes each of them.
A pool of equals
example.com. MX 10 mx-a.example.com.example.com. MX 10 mx-b.example.com.example.com. MX 10 mx-c.example.com.
All three share a value, so senders spread load across them in the order they choose. The mistake is leaving a host in the pool after it's been partially decommissioned, so a share of mail lands on a machine that's only half alive. Check it by watching traffic across the three for a day and looking for the host that takes noticeably less.
Hybrid during a migration
example.com. MX 10 newprovider.example.net.example.com. MX 20 oldserver.example.com.
The new system carries normal traffic while the old server stays reachable as a fallback. The mistake is pulling the old record the moment the new one looks healthy, before cached answers expire. Check it by confirming the old server still receives mail during the overlap, then removing the record only when its logs are quiet.
Practical rule: start with the simplest set that meets your redundancy need and add hosts only when a real failure case demands them.
Two hosts is a reasonable target for most businesses, one live and one failover. A pool only pays off when you need the capacity.
Address Records and Authentication Around MX Priority
An MX record's target must be a hostname, and that hostname needs its own A or AAAA record pointing to the mail server, as RFC 1035 defines the exchange field, per the RFC 1035 domain name specification. A valid pattern is example.com. MX 10 mail.example.com. followed by an address record for mail.example.com. An invalid pattern is an MX target written directly as an IP address. The MX record says which host accepts mail; the address record says where that host can be reached.
Here's the assumption worth challenging, because it costs teams days: that a clean MX change fixes delivery. It doesn't, because MX records never authenticated anything. They name inbound receivers. Your sending reputation lives in a completely different set of records, and a domain can have flawless MX order and still land in spam.
The other direction catches people too. A correctly formatted MX record can fail outright if the hostname behind it has no usable address, and the priority never gets a chance to matter.
Run this short check after any MX change, before you blame the order.
- Hostname resolves: the MX target answers with an A or AAAA record.
- SPF still lists your senders: every system that sends mail for the domain appears in the SPF record.
- DKIM selector still matches: the selector your signing service uses resolves at the expected name.
- DMARC still reporting: confirm your DMARC setup still reports as expected with a check DMARC record tool.
If one of those four is broken, fix it first. The priority order is very rarely the reason mail stops arriving after a move.
Troubleshooting Priority Problems by Symptom
The most common complaint after a change is that mail still reaches the old server. That's cached DNS at some resolvers and senders, and the fix is keeping the old host accepting mail until the TTL has expired, not editing the priority again.
Match what you see in your logs or bounces against the table below.
| Symptom | Likely cause | Fix |
|---|---|---|
| Mail still reaches the old server after a change | Cached MX answers at some resolvers and senders | Keep the old host accepting mail until the TTL has expired |
| Backup receives mail while the primary is up | Primary refuses recipients or its address record is broken | Check recipient acceptance and the A or AAAA record on the primary |
| Two equal hosts receive uneven traffic | Sender randomization among equal values, which is expected | Use distinct values only if strict order is required |
| Bounce names an IP address instead of a host | MX target written as an IP address, or hostname has no address record | Point the MX to a hostname that has a valid A or AAAA record |
| Authentication fails after the move | SPF or DKIM still lists the old sending system | Update SPF and DKIM for the new sending systems |
| Backup accepts mail it cannot deliver | Backup not configured for every recipient domain | Configure the backup for all recipients or remove it from the MX set |
Uneven traffic between two equal hosts deserves a second look only when it's extreme. A little imbalance is normal sender behavior, and chasing it by reordering values usually creates more problems than it solves.
First move: confirm the current MX values with a DNS lookup before changing anything else.
A wrong assumption about what's published sends you editing records that were fine all along.
Test Your MX Order Before Going Live
You've published the new set and the lookups agree. Before you call it done, run four checks in order.
- Confirm the MX values: query the set and check that the lowest value is the host you intend to receive mail first.
- Confirm every target resolves: each exchange hostname answers with an address, and each one accepts mail for the recipient domains it serves.
- Test each host, then the fallback: send a message to each host by name, simulate a primary failure, and confirm delivery lands on the next value.
- Run an email spam test: check how the receiving providers treat a message before you send real campaigns.
That last step is where an MX check stops and content and reputation testing begins. MailGenius offers a free email inbox placement test, and it provides inbox placement previews across Gmail, Outlook, Yahoo and more, so you can see whether a message reaches the primary inbox, the Promotions tab, or spam.
The placement test doesn't replace the MX checks above, because it reads delivery and content, not your priority order. It answers the question the DNS checks can't: has the message arrived where you want it, and does the provider believe it belongs there.
Write down the priority plan, run the checks, and schedule a follow-up after the TTL window to confirm mail is landing where it should. A change that looks clean on day one often reveals its real behavior on day three.
Fixing the order is only half the job, because a correct MX set still routes mail into a spam folder when authentication, reputation, or content tripped a filter along the way. MailGenius runs a free spam test across Gmail, Outlook, Yahoo and more, scoring the message and handing you prioritized fixes, and it pairs that with MX, SPF, DKIM and DMARC checks so you can see the whole picture instead of guessing at one record. Run a test before your next send and find out whether the priority you set is getting mail into the inbox.

