What an MX record does
An MX record maps a domain to one or more mail exchanger hostnames. The sending server queries DNS for the recipient domain, sorts the returned records by priority, resolves the selected hostname to an address, and then attempts SMTP delivery.
Priority and fallback
Lower MX preference values are tried first. Backup exchangers with higher values can accept mail when the primary host is unreachable, although modern setups often use multiple equal-priority hosts behind resilient infrastructure.
Common mistakes
MX records must point to hostnames, not raw IP addresses. Those hostnames need working A or AAAA records, and the receiving systems need to be ready to accept mail for the domain.
Examples
Simple MX setup
A domain might publish one primary exchanger such as 10 mail.example.com. The lower number means it is preferred, and mail.example.com must then resolve to a reachable server address.
Primary and backup exchangers
A common pattern is 10 mx1.example.com and 20 mx2.example.com. Senders try mx1 first, then fall back to mx2 if the primary host cannot be reached.
Common issues
- Publishing an MX record that points directly to an IP address.
- Forgetting the A or AAAA record for the mail exchanger hostname.
- Leaving old backup MX hosts in DNS after they stop accepting mail.
- Publishing MX records for a domain before the receiving server is configured to accept that domain.