MX API

Mail exchange records for a domain.

Mail exchange records for a domain. Each row is a priority and host, sorted the way mailers try them.

Empty mx means no mail exchanger. That is an answer, not an error. Records share the DNS API's cache and expire with their DNS lifetime, capped at one hour. Failed refreshes return 503 instead of old records.

For other record types and TTLs, use DNS. To check if a domain is free to register, use Domain.

LookupCopy link

GET /mx/{domain}API Explorer ↗

MX hosts and priorities (empty array if none)

Parameters

domainstring · path · required

Domain name

Example

Request

import { parseAPI } from '@parseapi/sdk';

const parse = parseAPI("YOUR_API_KEY");
const result = await parse.mx("gmail.com");
console.log(result);
Example response
{
  "domain": "gmail.com",
  "mx": [
    {
      "priority": 5,
      "host": "gmail-smtp-in.l.google.com"
    },
    {
      "priority": 10,
      "host": "alt1.gmail-smtp-in.l.google.com"
    }
  ]
}

Response fields

domainLink to domainstring
Hostname checked
mxLink to mxarray
Priority and host. A priority-0 host of . is null MX (accepts no mail); [] means no MX records.