MX Health API
developer/v1/dns/mx-healthChecks MX DNS records and, by default, actual inbound SMTP relay connectivity on port 25. Reads the greeting, sends EHLO, negotiates STARTTLS and verifies the TLS certificate without authenticating or sending mail.
What It Does
Discovers MX hosts and performs bounded SMTP relay probes on port 25, retaining greeting, capabilities, TLS negotiation, certificate verification and validation outcomes. Checks at most five MX hosts and reports truncation. Set smtp_probe=false for DNS-only checks. Submission ports 587/465 are not used as evidence of inbound MX relay health.
Why It's Useful
A name that says "Health" should health-check the actual mail service, not just resolve names. Reading the SMTP greeting and verifying the TLS handshake answers the questions email administrators actually have: is the server up? does it offer opportunistic TLS as RFC 8314 requires? are the cipher and certificate negotiation healthy? Failed handshakes and missing STARTTLS surface as actionable issues, not buried network noise. Complements SPF, DKIM, DMARC, and MTA-STS by testing the live mail-transport layer.
Use Cases
Pre-Campaign TLS Posture Check
Before launching a major campaign, verify that recipient mail servers accept connections AND offer opportunistic TLS on inbound relay port 25. The live SMTP probe sends EHLO, parses advertised capabilities, and confirms relay STARTTLS works — the exact controls Gmail and Microsoft 365 require under their bulk-sender policies.
Catch recipients whose MX is up but TLS is broken (expired cert, missing STARTTLS) — the failure mode that turns deliverable mail into spam-folder mail.
Vendor Email Security Assessment
Evaluate a vendor's mail infrastructure during onboarding. The probe surfaces whether their MX accepts inbound relay connections, advertises proper capabilities (SIZE, 8BITMIME, AUTH), and completes the handshake cleanly. Combined with SPF, DKIM, and DMARC checks, gives a complete email-stack posture in two API calls.
Identify partners running outdated or misconfigured mail servers before signing contracts that depend on reliable email exchange.
Continuous TLS-Posture Monitoring
Schedule mx-health probes against business-critical partner domains. Alert on `all_tls_ok` regressions — the most common cause is a silently-expired TLS cert on the MX, which degrades from "works" to "delivered as cleartext" without any visible error.
Detect TLS regressions on inbound mail paths within minutes, not after the certificate-monitoring tool finally surfaces the renewal.
Parameters
| Name | Location | Type | Required | Description |
|---|---|---|---|---|
domain | query | string | Required | The domain to check mail server health forExample: example.com |
smtp_probe | query | string | Optional | Set to "false" to skip the live SMTP probe and return only the DNS-level checks. Defaults to "true".Example: true |
Response Fields
Result fields below are inside the JSON data object. Any row named meta describes the sibling response metadata object. See response and error handling for status codes and error responses. Optional observations may be absent or null; inspect warnings and partial-failure fields before treating a missing result as a negative finding.
| Field | Type | Description |
|---|---|---|
domain | string | The queried domain |
mx_records | array | Per-MX priority, host, IPs, reachability and optional port-25 relay smtp_probe: greeting, capabilities, STARTTLS, certificate verification and completion status. |
has_valid_mx | boolean | Whether domain has at least one reachable MX server (resolves to A/AAAA records) |
all_reachable | boolean | Whether the measured MX relays connected; falls back to DNS reachability for DNS-only mode. Unknown when coverage is incomplete. |
smtp_probe_enabled | boolean | Whether the live SMTP probe ran (false when smtp_probe=false was passed) |
any_smtp_ok | boolean | True if at least one MX completed a successful SMTP handshake with TLS |
all_tls_ok | boolean | Whether all covered MX relays negotiated TLS; null if unmeasured or coverage is incomplete. Inspect tls_verified separately for certificate trust. |
issues | array | DNS, SMTP relay and TLS findings, with unavailable/truncated checks stated explicitly. |
count | number | Number of MX records found |
smtp_probe_truncated | boolean | True if more MX hosts exist than the five-host probe limit. |
mx_records[].smtp_probe.tls_verified | boolean | null | Whether the port-25 peer certificate passes hostname and public-CA verification. |
Code Examples
Replace YOUR_API_KEY with your API key. This endpoint requires the developer plan or higher; see plans and usage limits.
curl --request GET 'https://api.edgedns.dev/v1/dns/mx-health?domain=example.com' \
--header "Authorization: Bearer YOUR_API_KEY"const response = await fetch(
"https://api.edgedns.dev/v1/dns/mx-health?domain=example.com",
{
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
);
if (!response.ok) {
throw new Error(`EdgeDNS returned HTTP ${response.status}`);
}
const data = await response.json();
console.log(data);import requests
response = requests.request(
'GET',
"https://api.edgedns.dev/v1/dns/mx-health?domain=example.com",
headers={'Authorization': 'Bearer YOUR_API_KEY'},
timeout=60,
)
response.raise_for_status()
data = response.json()
print(data)Read the full MX Health guide
Learn the concepts, choose a practical workflow, and interpret the observations from MX Health before acting on them. Run supported checks via MCP or through REST.
Read the guide →Related Endpoints
External References
Learn more about the standards and protocols behind this endpoint.