How to Check an MX Record for a Domain
MX records decide where incoming mail for a domain should be delivered. Checking them properly means looking at the MX hostnames, their priority values, the A or AAAA records behind those hostnames and whether different resolvers still have stale answers.
Start with the domain MX answer
Query the domain itself, not the mail hostname. The answer should contain one or more mail exchanger hostnames with preference numbers.
dig example.com MX +short
dig @1.1.1.1 example.com MX
dig @8.8.8.8 example.com MXVerify the MX targets resolve
An MX target must be a hostname. After finding the targets, check their A and AAAA records so senders can connect to them.
dig mail.example.com A +short
dig mail.example.com AAAA +shortWhat the priority number means
- Lower MX preference values are tried first by normal mail senders.
- Multiple records with the same priority can distribute delivery attempts.
- Backup MX hosts should still be able to queue or deliver mail correctly.
- Changing MX records during a provider migration can remain cached until the previous TTL expires.
Common MX mistakes
Pointing MX directly to an IP address
MX records should point to hostnames, then those hostnames resolve to IP addresses.
Removing old mail service too early
Senders behind cached MX answers may still attempt delivery to the previous provider.
Forgetting SPF after changing MX
MX controls inbound mail; SPF and DKIM still need to match outbound mail providers.
Testing only one resolver
A local resolver can show a new MX while other public resolvers still return old data.