# MX Lookup API

> MX Lookup queries DNS to find MX records for any domain. It returns an array of mail exchange hostnames and their priority routing values in real time.

**Endpoint:** `GET https://api.apiverve.com/v1/mxlookup`  
**Category:** Domain Data  
**Cost:** 10 credits per call  
**Canonical page:** https://apiverve.com/marketplace/mxlookup

## Overview

Pass any domain name to run a live DNS lookup for its mail configuration. The response returns the queried domain and an array of MX entries, showing each mail exchange server hostname paired with its priority routing integer. It works as an MX record check API inside signup or deliverability flows, and because each request covers one domain, a bulk MX lookup over a list is a simple loop from a script or spreadsheet.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/mxlookup?domain=yahoo.com" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | Yes | The domain you want to get the MX records for (e.g. yahoo.com). domain |

## Response fields

- `domain` — string · The domain name that was queried for MX records
  - `mx.0.priority` — number · Priority value of the MX record for routing
  - `mx.0.exchange` — string · Mail exchange server hostname for receiving emails
  - `mx.0.ips` — array · IPv4 addresses the mail host resolves to · (premium)
  - `mx.0.reverseDns` — string · Reverse DNS (PTR) name of the host's first IP, or null · (premium)
  - `mx.0.reverseDnsConfirmed` — boolean · Whether that PTR name resolves back to the same IP (forward-confirmed reverse DNS, which receiving servers check); null when there is no PTR · (premium)
- `acceptsMail` — boolean · false when the domain publishes a null MX (RFC 7505), declaring that it accepts no email
- `isNullMx` — boolean · Whether the domain publishes a null MX record ("0 ."); mx is then empty
- `provider` — string · Who runs the domain's inbound mail, read from the MX hosts (Google, Microsoft, Proofpoint...); null when not recognised · (premium)
- `isSecurityGateway` — boolean · Whether the provider is an email security gateway (Proofpoint, Mimecast) in front of the real mailbox host · (premium)
- `ttl` — number · Seconds the MX set stays cached, as a public resolver serves it · (premium)

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "domain": "yahoo.com",
    "mx": [
      {
        "priority": 1,
        "exchange": "mta6.am0.yahoodns.net",
        "ips": [
          "67.195.204.73",
          "67.195.228.110",
          "98.136.96.91",
          "67.195.228.106",
          "67.195.204.77",
          "67.195.228.94",
          "67.195.204.74",
          "67.195.204.72"
        ],
        "reverseDns": "mtaproxy4.free.mail.vip.bf1.yahoo.com",
        "reverseDnsConfirmed": true
      },
      {
        "priority": 1,
        "exchange": "mta7.am0.yahoodns.net",
        "ips": [
          "67.195.204.72",
          "98.136.96.74",
          "67.195.204.74",
          "98.136.96.91",
          "67.195.204.73",
          "98.136.96.76",
          "67.195.228.110",
          "67.195.228.94"
        ],
        "reverseDns": "mtaproxy3.free.mail.vip.bf1.yahoo.com",
        "reverseDnsConfirmed": true
      },
      {
        "priority": 1,
        "exchange": "mta5.am0.yahoodns.net",
        "ips": [
          "67.195.204.79",
          "67.195.228.94",
          "67.195.228.109",
          "67.195.228.110",
          "98.136.96.76",
          "67.195.204.72",
          "67.195.204.74",
          "67.195.204.77"
        ],
        "reverseDns": "mtaproxy2.free.mail.vip.bf1.yahoo.com",
        "reverseDnsConfirmed": true
      }
    ],
    "acceptsMail": true,
    "isNullMx": false,
    "provider": "Yahoo",
    "isSecurityGateway": false,
    "ttl": 503
  }
}
```

## Use cases

- **Signup Email Validation** — To stop fake signups, authentication workflows check MX records to confirm the registrant's email domain can actually accept incoming messages.
- **Domain Migration Auditing** — DevOps engineers track exchange hostnames and priority numbers before and after DNS changes to verify mail traffic directs to new servers.
- **Cold Outreach Deliverability** — Sales outreach software verifies that recipient domains have active mail servers before scheduling outbound campaign sequences to protect sender reputation.
- **Mail Provider Detection** — Identify whether a prospect uses Google Workspace, Microsoft 365, or self-hosted infrastructure by parsing the returned exchange server hostnames.

## SDKs

- **npm** — `npm install @apiverve/mxlookup` (https://www.npmjs.com/package/@apiverve/mxlookup)
- **NuGet** — `dotnet add package APIVerve.API.MXLookup` (https://www.nuget.org/packages/APIVerve.API.MXLookup)
- **Source** — https://github.com/apiverve/mxlookup-api

## More

- Full reference: https://docs.apiverve.com/ref/mxlookup
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
