---
title: "Look up the MX records of a domain"
description: "The mail hosts of any domain in the order senders try them, with their addresses."
url: "https://nextmail.sh/docs/api/tools/mx"
area: "API"
category: "Mailbox"
---

# Look up the MX records of a domain

The mail hosts of any domain in the order senders try them, with their addresses.

`GET /tools/mx`

## GET /tools/mx

The mail hosts of any domain in the order senders try them, with their addresses.

## Example

Needs no scope. `hosts` are in the order senders try them, lowest `preference` first, each with its IPv4 and IPv6 `addresses` and their reverse DNS, and `provider` names the mail provider when it is recognised. `nullMx` is true when the domain states it takes no mail, and `implicit` holds the addresses senders fall back to when there is no MX at all.

**curl**

```
curl "$API/tools/mx?domain=acme.com" -H "$AUTH"
```

**Response**

```
{
  "object": "mx_report",
  "domain": "acme.com",
  "status": "pass",
  "hosts": [
    {
      "preference": 1,
      "exchange": "smtp.google.com",
      "ttl": 3600,
      "aliasOf": null,
      "addresses": [
        { "address": "142.250.153.27", "family": "ipv4", "reverse": "ea-in-f27.1e100.net", "reserved": false },
        { "address": "2a00:1450:4013:c16::1b", "family": "ipv6", "reverse": "ea-in-x1b.1e100.net", "reserved": false }
      ],
      "provider": "Google Workspace",
      "findings": []
    }
  ],
  "nullMx": false,
  "implicit": null,
  "provider": "Google Workspace",
  "findings": [
    { "code": "single-host", "severity": "notice", "message": "One mail host, which is normal for Google Workspace: the name points at many servers behind it.", "subject": "Google Workspace", "value": null },
    { "code": "all-resolve", "severity": "pass", "message": "Every mail host resolves to an address.", "subject": null, "value": null }
  ]
}
```

> An MX that is an alias (CNAME) or a bare address, a host that does not resolve and a private address each have a finding of their own, with the host or address in `subject`.

## Reference

- [`GET /tools/mx`](https://nextmail.sh/docs/api/reference/tools#get-tools-mx): full reference
