MX Lookup

Look up MX (Mail Exchange) records for any domain. Returns all mail server hostnames and their priorities, sorted from highest to lowest priority (ascending numeric value). Use this to verify email deliverability, discover mail server infrastructure, and diagnose email routing issues.

Get API Key

Overview

Use Cases

  • Verifying a domain is configured to receive email before sending
  • Email deliverability checks in validation pipelines
  • Discovering mail server infrastructure for a domain
  • Diagnosing email routing and delivery issues
  • Building email validation tools that go beyond syntax checking

Features

Returns all MX records for any domain
Records sorted by priority (lowest numeric value = highest priority)
Includes both hostname and priority for each mail server
Returns 404 when no MX records exist for the domain

API Endpoints

MX Lookup

Retrieve all MX records for a domain. Results are sorted by priority ascending (lowest numeric value has highest mail delivery priority per RFC 5321).

GET
https://requiems.xyz/v1/networking/mx/{domain}

Parameters

Name Type Required Description
domain string Required The domain name to look up MX records for (e.g. gmail.com)

Try it out

Live Demo
Request

The domain name to look up MX records for (e.g. gmail.com)

Response Fields

Field Type Description
domain string The domain that was queried
records array<object> List of MX records, sorted by priority ascending (lowest number = highest priority)
records[].host string Fully-qualified hostname of the mail server (typically ends with a trailing dot)
records[].priority integer MX priority value. Lower values have higher delivery priority per RFC 5321.

Code Examples

curl "https://requiems.xyz/v1/networking/mx/gmail.com" \
  -H "requiems-api-key: YOUR_API_KEY"

Error Responses

bad_request

The domain parameter is not a valid domain name.

not_found

No MX records were found for the domain (domain may not accept email).

internal_error

DNS lookup failed due to an unexpected server error.

Batch MX Lookup

Retrieve MX records for up to 50 domains in a single request. Results for each domain are sorted by priority ascending (lowest numeric value has the highest mail delivery priority per RFC 5321).

POST
https://requiems.xyz/v1/networking/mx/batch

Parameters

Name Type Required Description
domains array<string> Required Array of domains to lookup (min: 1, max: 50).

Try it out

Live Demo
Request

Array of domains to lookup (min: 1, max: 50).

Response Fields

Field Type Description
results array<object> MX lookup results for each input domain, in the same order as the input.
results[].domain string The domain name that was queried.
results[].found boolean Whether MX records were found for the domain.
results[].error string Error message if the lookup failed. Empty if found is true.
results[].data object MX lookup data. Present only when found is true.
results[].data.domain string The domain name associated with the MX records.
results[].data.records array<object> List of MX records sorted by priority ascending (lower value means higher priority).
results[].data.records[].host string Hostname of the mail server.
results[].data.records[].priority number Priority of the mail server. Lower value means higher priority.
total number Total number of results returned.

Code Examples

curl -X POST "https://requiems.xyz/v1/networking/mx/batch" \
  -H "requiems-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domains":["outlook.com", "yahoo.com"]}'

Error Responses

validation_failed

The domains array is missing, empty, or contains more than 50 items.

internal_error

DNS lookup failed due to an unexpected server error.

Frequently Asked Questions