An MX (mail exchange) record names the mail servers responsible for receiving email for a domain. Each record carries a priority — lower numbers are preferred — and a hostname that must resolve via A or AAAA records. Multiple MX records at the same priority are tried in random order, while different priorities form a primary/backup chain.
Why it matters
If MX records are missing, wrong, or stale, inbound email fails silently or bounces with cryptic SMTP errors. Receivers also use MX data when scoring spam: a domain whose mail is supposed to flow through a known provider but suddenly resolves elsewhere is a fraud signal. Clean MX plus matching SPF, DKIM, and DMARC policies are the baseline for any domain that sends or receives mail.
How to fix
- Run
dig MX example.comand confirm each hostname resolves to a mail server you control or actually use. - Use multiple
MXrecords or a provider with built-in failover so a single outage does not bounce mail. - Keep
MXtargets as plain hostnames with their own A records — aCNAMEat anMXtarget is invalid per RFC 2181. - Pair
MXwith TXT records for SPF, DKIM, and DMARC. - When migrating, lower the TTL beforehand and verify both old and new servers route mail during cutover.
- Set
MX 0 .for domains that should never receive mail.