Skip to main content

MX Records

free
GET/v1/dns/mx

Retrieves 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 Administrator

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.

Security Analyst

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.

IT Consultant

Migration Planning

Document current email infrastructure before migrating clients to a new email platform.

Ensure smooth email migrations by understanding existing mail routing.

Parameters

NameTypeRequiredDescription
domainstringRequiredThe domain to query MX records forExample: google.com

Response Fields

FieldTypeDescription
domainstringThe queried domain
has_mxbooleanWhether domain has MX records configured
is_null_mxbooleanWhether domain uses Null MX (RFC 7505) to reject email
mx_recordsarrayPer-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)
providerobjectDetected email provider name, type, features, confidence, and backup_provider (backend provider behind security gateways)
unique_asnsnumberDistinct ASNs across all MX IPs — useful for redundancy assessment
unique_countriesnumberDistinct ISO country codes across all MX IPs
sanity_flagsarrayDetected misconfigurations with severity and code: mx_points_to_cname (RFC 5321 §5.1), mx_private_ip, mx_lame
linked_endpointsarraySuggested follow-up endpoints (/v1/security/spf, /v1/security/dmarc, /v1/dns/mx-health) for full email-stack analysis
record_countnumberNumber of MX records found

Code Examples

cURL
curl "https://api.edgedns.dev/v1/dns/mx" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=google.com"
JavaScript
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);
Python
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.

Try This Endpoint

Test the MX Records endpoint live in the playground.