Skip to content
AdminKit

Backup MX

What is Backup MX?

A backup MX is a mail server listed in a domain's MX records with a higher preference number than the primary, so senders try it only when the lower-numbered hosts cannot be reached. AdminKit's MX lookup lists a domain's MX hosts in priority order and checks whether up to 5 of them resolve.

By AdminKit team, Netbase JSC · Updated

Every MX record carries a preference number. RFC 5321 section 5.1 says that number must be used to sort the hosts, that lower numbers are more preferred, and that hosts sharing the same number are picked at random to spread the load. Microsoft’s domains FAQ puts it the same way: mail is delivered to the server with the lowest preference number. A backup MX is any host listed with a higher number than the primary, for example:

example.com.  3600  IN  MX  10  mx1.example.com.
example.com.  3600  IN  MX  20  backup-mx.example.net.

A sender tries mx1 first and connects to the backup only if mx1 cannot be reached. The same RFC section covers the backup’s side: a server that receives mail for a domain it is listed for may relay it, and when it looks up the MX list again it must drop its own entry and every host at the same or a higher number, so it only passes the message toward a more preferred host. In practice the backup queues the message and keeps trying the primary until it comes back.

Why does a backup MX without the same filtering attract spam?

Preference numbers are a request, not a barrier. Any sender can connect straight to the backup host while the primary is working, and senders of junk mail can do so on purpose if the backup is easier to get past. A backup that accepts every recipient at the domain and skips the primary’s spam checks takes in mail the primary would have refused. When it later forwards that mail and the primary rejects unknown recipients, the backup has to return the message to its sender address, which is often forged, and that becomes backscatter.

The Postfix documentation for a backup MX host shows the fix in its configuration example. The backup runs the same spam-blocking rules in its recipient restrictions, and it keeps a list of the domain’s valid addresses, which the documentation says stops its queue from filling up with undeliverable MAILER-DAEMON messages. It also rejects mail for domains it does not serve, so the backup relays only for the domains it backs up and never becomes an open relay. AdminKit’s guide on what MX record priority actually does covers the same rule: a backup needs the same filtering as the primary.

How do you check a domain’s backup MX?

AdminKit’s MX lookup lists a domain’s MX records in priority order with each record’s TTL, then checks whether up to 5 of the mail hosts resolve to IPv4 and IPv6 addresses. A backup host that no longer resolves stays hidden until the primary fails, so it is worth looking at before an outage. Backup MX is part of AdminKit’s email authentication cluster; the full AdminKit glossary lists other related terms.

Frequently asked questions

When does a sending server use the backup MX?

When it cannot deliver to the more preferred hosts. RFC 5321 section 5.1 says MX preference must be used for sorting and lower numbers are more preferred, so a sender tries the lowest-numbered host first and moves on to higher numbers only if those cannot be reached.

Do I need a backup MX at all?

Not always. RFC 5321 expects a sender that cannot deliver to keep the message queued and retry, with a give-up time that generally needs to be at least 4-5 days, so a short outage of a single MX does not lose mail on its own. A backup MX is useful when mail must be accepted during a long outage, and only if it is run as carefully as the primary.

What happens if two MX records share the same preference?

They are not primary and backup; they form one group. RFC 5321 says that when there is no clear reason to favour one, the sender must pick among them at random to spread the load.

Why does my backup MX send so many bounces?

Usually because it accepts mail for any address at the domain and only finds out later, when the primary refuses it, that the recipient does not exist. It then has to bounce the message to a sender address that is often forged. The Postfix documentation's fix is a list of valid recipients on the backup host.