DNS · MX
MX record lookup
MX records tell senders where to deliver mail for a domain. Each MX has a preference value — lower numbers tried first, ties broken randomly. Use to verify mail routing or diagnose delivery failures.
beginner
MX
How to look it up
Four ways to query — pick by what's available on your machine.
digdig MX example.com +short
hosthost -t MX example.com
nslookupnslookup -type=MX example.com
dotdigdotdig mx example.com
Sample response
10 mx1.example.com. 10 mx2.example.com. 20 backup-mx.example.com.
Format
Format: `<preference> <hostname>.`. Lower preference is preferred. The trailing dot is part of the FQDN.
Common pitfalls
- MX records MUST point to A/AAAA records, NOT CNAMEs (RFC 2181). Mailers may reject CNAME-pointed MX.
- Multiple MX with same preference = round-robin between them. To prefer one mailer, give it the lowest preference value.
- Missing MX → mail delivery falls back to the A record of the domain itself (RFC 5321 §5.1). Most operators turn this off explicitly with `0 .` 'null MX' record.
Why it matters for security
security relevance
MX records expose your mail infrastructure — attackers use them to identify mail providers and craft spoofing campaigns. Pair with SPF/DKIM/DMARC.
Use cases
- Diagnose 'mail not arriving' complaints
- Verify MX after switching providers
- Check for backup MX before failover testing
- Audit external mail flow
Look up DNS without flag soup
dotdig is a friendly DNS resolver — formatted output, custom resolver support, DNSSEC validation. Zero-config alternative to dig.
Open dotdig
Related DNS lookups
NS · TXT · PTR · CNAME · ↗ validate emails before MX lookup