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.

Lookup

GET
api.parseapi.com/mx/{domain}
MX hosts and priorities (empty array if none)
Explore
Parameters 1
domainstring · path · required

Domain name

Run uses free demo access. Use your API key for copied requests.

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

const parse = parseAPI("YOUR_API_KEY");
const result = await parse.mx("gmail.com");
console.log(result);

Run on your server with a secret key. Calling from a browser or app?

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

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

Questions? Email