Skip to main content

MX Health

developer
GET/v1/dns/mx-health

Performs health checks on mail servers by verifying MX record DNS resolution and checking redundancy configuration. Resolves each MX host to A and AAAA records to confirm DNS-level reachability. Detects Null MX (RFC 7505) domains and identifies potential delivery issues including single-server configurations and fake redundancy (all MX records resolving to the same IP).

What It Does

Resolves each MX server to verify DNS reachability (both A and AAAA records for IPv4/IPv6), checks for proper redundancy (multiple MX records with different priorities and distinct IP addresses), and detects Null MX configurations (RFC 7505). Note: SMTP port connectivity checks are not performed because Cloudflare Workers' shared IP ranges are commonly blocked by major mail providers.

Why It's Useful

Verifies that mail server DNS records are properly configured and resolvable before issues affect email delivery. Complements SPF, DKIM, and DMARC checks by testing the underlying mail server DNS infrastructure. Identifies MX hosts that lack A or AAAA records, single points of failure, and fake redundancy.

Use Cases

Email Marketing Manager

Pre-Campaign Health Check

Before launching a major campaign, verify that recipient domains' mail servers are healthy and accepting connections.

Avoid sending to domains with offline mail servers, improving campaign metrics.

Procurement Manager

Vendor Email Reliability Assessment

Evaluate the email infrastructure reliability of potential vendors or partners before signing contracts.

Ensure business-critical communications won't be lost due to partner email issues.

SRE / DevOps

Continuous Monitoring

Set up automated health checks for critical business partner domains to detect DNS-level mail server issues early.

Detect unreachable MX targets, missing A records, and single points of failure before they cause delivery failures.

Parameters

NameTypeRequiredDescription
domainstringRequiredThe domain to check mail server health forExample: example.com

Response Fields

FieldTypeDescription
domainstringThe queried domain
mx_recordsarrayHealth status for each MX server including hostname, priority, resolved IPs (A and AAAA), reachability status, and error details
has_valid_mxbooleanWhether domain has at least one reachable MX server (resolves to A/AAAA records)
all_reachablebooleanWhether all MX servers resolve to at least one IP address
issuesarrayList of detected issues: missing A/AAAA records, no redundancy, same-IP redundancy, Null MX
countnumberNumber of MX records found

Code Examples

cURL
curl "https://api.edgedns.dev/v1/dns/mx-health" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "domain=example.com"
JavaScript
const response = await fetch(
  'https://api.edgedns.dev/v1/dns/mx-health?domain=example.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-health',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
    'domain': 'example.com'
    }
)

data = response.json()
print(data)

Read the full MX Health 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 Health endpoint live in the playground.