Skip to content

GlossaryEmail

MX record

Definition

An MX record names the server responsible for receiving a domain's mail, together with a preference number. A domain usually publishes several: the sending server tries the lowest preference first and moves to the next one if that fails to answer.

The record everyone forgets

A site migration does not touch email, except when it goes through a name server change — that one takes the whole zone with it. The site appears, the mail disappears, and nobody connects the two for two days, because a rejected message does not always bounce back to the sender straight away.

The number in front of the name is not a priority in the everyday sense, it is a preference: the lower it is, the earlier that server gets tried. Two MX records with the same value share the load. And a server issuing a temporary refusal pushes the sender on to the next one, which is how a domain survives an outage without losing mail.

Two receiving servers

The primary, the backup, and the address of the first one.

example.com. 3600 IN MX 10 mail1.example.net. example.com. 3600 IN MX 20 mail2.example.net. mail1.example.net. 3600 IN A 203.0.113.25

An MX target must be a name that itself carries an A or AAAA record: never a bare IP address, never an alias. It is the most frequently broken rule in the DNS, and the one that produces the hardest rejections to read.

The usual mistake

Writing an IP address where the name belongs, because the host's interface takes it without complaint. Some sending servers ignore it, others refuse outright: the domain starts receiving mail from some senders and not others, which takes far longer to diagnose than a clean outage.

How to avoid it: Always a named target, with its own A or AAAA record. And after anything that touches name servers, read the MX records back before you announce the migration is finished: thirty seconds of checking against two days of lost email.

Source: The MX record is defined in RFC 1035 and the order in which preferences are tried in RFC 5321. The ban on pointing an MX at an alias comes from RFC 2181.

Related terms

Where to go next

Knowing the words is half the job

The other half is knowing which of your domains is about to become a problem. DomainVigil watches expiry, DNS, certificates and reputation, and tells you before your client does.

Start for free

Five domains free, forever. No card required.

Back to the glossary