MX records tell other mail servers where to deliver mail for your domain. Each one has a priority (lower is tried first) and a host name:
example.com. MX 10 mx1.example.net.
example.com. MX 20 mx2.example.net.
When they are wrong, mail to you bounces with errors like 550 5.1.2 Host unknown or Domain has no MX records,
sits in senders' queues for days, or ends up at a provider you no longer use.
Common problems
- No MX records. Senders then try the domain's own A record, usually a web server that doesn't accept mail. Publish the MX records your mail provider gives you, or a null MX if the domain shouldn't receive mail.
- The MX points to a CNAME. MX targets must be host names with their own A or AAAA records, not aliases (RFC 2181). Many servers tolerate it, some don't. Point the MX at the final host name.
- The MX is an IP address (
MX 10 203.0.113.25). Not allowed: create a host name likemail.example.comwith an A record, and point the MX at that. - The host name doesn't resolve, or resolves to a private address like
10.0.0.5or192.168.1.10. Nobody on the internet can deliver there. This often happens after moving a mail server or copying records from an internal DNS. - Still pointing at the old provider after a migration. The old provider may accept mail for a while and then start rejecting it with user unknown or relay access denied.
- Only one MX host for your own server. Senders retry for a few days when it's down, so this is fine for hosted providers (their one name hides many servers), but risky for a single server of your own.
Check your records
dig MX example.com +short
10 mx1.example.net.
dig A mx1.example.net +short
198.51.100.10
Every name in the MX answer should resolve to a public IP address. If you use MTA-STS,
remember to update the mx: lines of your policy whenever you change your MX records.