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.
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?
What does priority 10 mean?
How do I check MX plus verify an email address?
Does this return SPF, DKIM, or DMARC records?
What if the domain uses a null MX (RFC 7505)?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.