MX record
An MX record (Mail Exchanger) is a DNS entry that names the mail servers responsible for accepting email addressed to a given domain. Without a correct MX record, mail to someone@example.com has nowhere to go, even if the website runs flawlessly.
How an MX record works
When a sending server wants to deliver a message, it queries DNS for the recipient domain's MX records. Each entry has two key fields:
- priority — a number setting the order; the lower it is, the higher the priority,
- mail server name — e.g. mail.example.com, which must resolve to an address via an A record.
The sending server first tries to deliver to the host with the lowest priority; if it does not respond, it moves to the next. Importantly, the name in an MX record should point to an A record, not a CNAME — such a setup is non-standard and is sometimes rejected.
The MX record in practice
You set an MX record whenever you enable email for a domain, whether on your own server or with an external provider. Email configuration is more than MX, though: to keep messages out of spam, the domain is supplemented with authentication records in the form of TXT entries — SPF, DKIM and DMARC. After changing mail providers, you update the MX records, keeping in mind the TTL-dependent propagation.
Powiązane pojęcia
Najczęstsze pytania
What is the priority in an MX record for?
The priority (lower number = higher priority) sets the order in which the sender's servers try to deliver mail. The lowest value is chosen first; the others act as backups when the primary is unavailable. Several records with the same priority balance the load.
