Bookmarks

MX — MX record

Mail Exchanger record

A line in a domain’s DNS zone that says which servers accept mail for the domain and sets their priority: the lower the number, the earlier the server is tried.

Also: MX record, mail exchanger, DNS mail record

checked 9 Nov

All terms

To send a message to anna@example.net, the sender’s server asks DNS for the MX records of example.net and receives the names of mail servers. Without these records, the sender tries the domain’s own address (an A or AAAA record).

What a record looks like

textPreference 10 is the primary server, 20 is the backup
example.net.  3600  IN  MX  10 mx1.example.net.example.net.  3600  IN  MX  20 mx2.example.net.
FieldMeaning
Preferencea number: the lower value is preferred; servers with equal numbers are chosen at random
Server namethe name of a host that has an A or AAAA record

Rules

The sender tries servers in ascending order of preference; if the first is unreachable, it moves on to the next (RFC 5321, section 5). The server name must not be an alias (CNAME, RFC 2181). If a domain has no MX but has an A or AAAA record, that record acts as an implicit MX with preference 0. A domain that does not accept mail publishes a “null MX”, a single 0 . record (RFC 7505).

An MX record answers only the question “where to deliver”. It does not verify the sender: SPF, DKIM and DMARC do that. The mail server may be outside the domain, so MX most often points to the name of a hosting provider or a cloud mail service.

Sources

the term is written from these pages

Verified 9 Nov

Not to be confused with

what it is mixed up with and how it differs

  • SPFSender Policy Framework

    SPF says where a domain sends mail from, whereas MX says where it is received.

  • PTRPTR record

    PTR maps an IP address to a name and is used to check the sending server, not the receiving one.

In depth in the references

where the topic is covered in detail