Prompt
How do I tell if an email domain has valid MX records?
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
To check whether an email domain has valid MX records, you can query its DNS MX record set.
What to look for
A domain “has valid MX records” if:
- It returns one or more MX records
- Those MX records point to real hostnames that resolve in DNS
- The records have sensible priorities (lower number = higher preference)
Quick ways to check
1) Using dig (Linux/macOS/Windows with tools installed)
dig MX example.com
If MX records exist, you’ll see something like:
example.com. 3600 IN MX 10 mail.example.com.
example.com. 3600 IN MX 20 backup.example.com.
2) Using nslookup
nslookup -type=mx example.com
3) Using host
host -t mx example.com
How to interpret results
- MX records present: good sign for mail delivery
- No MX records: many mail systems will fall back to the domain’s A/AAAA record, but that depends on the sender and is not ideal
- MX points to a hostname that doesn’t resolve: invalid/broken setup
- MX points to itself without proper A/AAAA: may still be acceptable in some setups, but the target must resolve
Programmatic check
If you’re writing code, query DNS for MX records and then verify each target hostname has A/AAAA records.
Example logic:
- Lookup MX for domain
- If none, domain may still receive mail via A/AAAA fallback
- For each MX host, ensure it resolves to an IP address
Important note
Having valid MX records does not guarantee the mailbox exists or that the server accepts mail for a specific address—only that the domain is configured to receive email at those mail servers.
If you want, I can also show you how to check this in Python, JavaScript, or with a one-liner in the terminal.