Ir al contenido
POST AI agent ready /v1/mx/check

MX Record Check API - DNS Mail Exchanger Lookup

Queries Cloudflare DNS for MX records on a domain and returns the mail exchanger hostnames and priorities, sorted ascending by priority. Trailing dots are stripped from hostnames. Returns an empty records array and has_mx: false when the domain has no MX records.

Parameters

stringrequired

Domain to query (without protocol or path).

Code examples

curl -X POST https://api.botoi.com/v1/mx/check \
  -H "Content-Type: application/json" \
  -d '{"domain":"stripe.com"}'

When to use this API

Detect the email provider behind a domain

MX exchanges ending in .aspmx.l.google.com identify Google Workspace. *.outlook.com exchanges indicate Microsoft 365. Use the pattern to route marketing or support based on the prospect's infrastructure.

Validate a domain accepts mail before onboarding

When a business customer signs up with a custom domain, confirm has_mx is true before creating their email-sending configuration. Prevents broken setups where the domain has no mail infrastructure.

Monitor MX record changes

Run this check nightly for domains you depend on. Alert when the set of records changes: a new MX can signal a provider migration or (rarer) a DNS takeover.

Frequently asked questions

Why are multiple records at the same priority returned?
Mail servers load-balance across equal-priority MX hosts. It is normal to see alt1 and alt2 at priority 5, for example. Sending mail should alternate between them randomly when the primary is unreachable.
What does priority 10 mean?
Lower priority numbers are preferred. A priority-1 host is tried first; priority 5 and 10 are fallbacks used when the lower-priority host is unreachable. The absolute value does not matter, only the relative order.
How do I check MX plus verify an email address?
Use /v1/email-mx/verify instead. It takes a full email address, extracts the domain, runs the MX lookup, and adds a deliverable flag.
Does this return SPF, DKIM, or DMARC records?
No. MX records only. For email-authentication DNS use /v1/dns-security/spf-check, /v1/dns-security/dkim-check, and /v1/dns-security/dmarc-check.
What if the domain uses a null MX (RFC 7505)?
A null MX record (priority 0, exchange ".") is returned in the records array with the exchange field empty after trailing-dot stripping. It signals the domain explicitly rejects all mail.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.