MX Records
free/v1/dns/mxRetrieves MX (Mail Exchange) records for a domain and identifies the email service provider. Returns mail server hostnames, priority values, and provider detection for Google Workspace, Microsoft 365, Proofpoint, Mimecast, Barracuda, Amazon SES, ProtonMail, Zoho, Fastmail, iCloud Mail, and more.
What It Does
Queries MX records, identifies the email provider and security gateways, and surfaces three classes of misconfiguration as `sanity_flags`: MX hostnames that resolve via CNAME (a violation of RFC 5321 §5.1 that breaks delivery on strict resolvers), MX hostnames that resolve to private/reserved IPs (mail will never reach them), and lame mail delegation (MX with no A or AAAA at all). Detects Null MX (RFC 7505) — the explicit "this domain does not accept mail" signal. Enriches each MX IP with its ASN and country code via Team Cymru, surfaces unique-ASN and unique-country counts for diversity assessment, and returns a `linked_endpoints` hint for callers who want full SPF/DMARC/MX-Health analysis.
Why It's Useful
The sanity flags catch the three failure modes responsible for most "why isn't email arriving?" tickets — RFC 5321 forbids MX→CNAME, RFC 1918 IPs in MX records mean mail never leaves, and lame MX is invisible to plain `dig`. ASN + country enrichment gives M&A due diligence and fraud teams a clear "your MX moved to AS in another country" anomaly signal without writing the lookup themselves. Provider detection identifies the security gateways (Proofpoint, Mimecast, Barracuda) and downstream providers in the mail path so callers understand the defense stack.
Use Cases
Email Deliverability Troubleshooting
Emails to a specific domain are bouncing. Check if MX records exist and are properly configured.
Quickly diagnose email delivery issues by verifying mail server configuration.
Email Security Posture Assessment
Map an organization's email security stack by identifying security gateways (Proofpoint, Mimecast, Barracuda), cloud email providers, and backup mail servers from MX records.
Understand email infrastructure defenses without active scanning — identify gaps in the security gateway chain.
Migration Planning
Document current email infrastructure before migrating clients to a new email platform.
Ensure smooth email migrations by understanding existing mail routing.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Required | The domain to query MX records forExample: google.com |
Response Fields
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain |
has_mx | boolean | Whether domain has MX records configured |
is_null_mx | boolean | Whether domain uses Null MX (RFC 7505) to reject email |
mx_records | array | Per-MX detail: priority, host, ttl, ips[], asns[] (each {asn, country}), points_to_cname (RFC 5321 §5.1 violation), has_private_ip, has_no_address (lame) |
provider | object | Detected email provider name, type, features, confidence, and backup_provider (backend provider behind security gateways) |
unique_asns | number | Distinct ASNs across all MX IPs — useful for redundancy assessment |
unique_countries | number | Distinct ISO country codes across all MX IPs |
sanity_flags | array | Detected misconfigurations with severity and code: mx_points_to_cname (RFC 5321 §5.1), mx_private_ip, mx_lame |
linked_endpoints | array | Suggested follow-up endpoints (/v1/security/spf, /v1/security/dmarc, /v1/dns/mx-health) for full email-stack analysis |
record_count | number | Number of MX records found |
Code Examples
curl "https://api.edgedns.dev/v1/dns/mx" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d "domain=google.com"const response = await fetch(
'https://api.edgedns.dev/v1/dns/mx?domain=google.com',
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
const data = await response.json();
console.log(data);import requests
response = requests.get(
'https://api.edgedns.dev/v1/dns/mx',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
params={
'domain': 'google.com'
}
)
data = response.json()
print(data)Read the full MX Records guide
Why it matters, real-world use cases, parameters, response fields, and how to call it from Claude, ChatGPT, or Gemini via MCP.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.