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
example.net. 3600 IN MX 10 mx1.example.net.example.net. 3600 IN MX 20 mx2.example.net.| Field | Meaning |
|---|---|
| Preference | a number: the lower value is preferred; servers with equal numbers are chosen at random |
| Server name | the 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 pagesVerified 9 Nov