---
name: dns-lookup
description: Look up DNS records (A, AAAA, CNAME, MX, TXT, NS, SOA, PTR, SRV, CAA, HTTPS) for any domain via a free JSON API. Use when you need a domain's IP addresses, mail servers, name servers, TXT records (SPF, DMARC, verification), or to check whether a domain exists.
---

# DNS Lookup

No authentication or API key required.

## Query

`GET https://domainnamesystem.pages.dev/resolve?name=<domain>&type=<types>`

- `name` (required): domain, e.g. `google.com`
- `type` (optional): comma-separated record types.
  - omitted = default set: A, AAAA, CNAME, MX, TXT, NS
  - `ALL` = every supported type: A, AAAA, CNAME, MX, TXT, NS, SOA, CAA, HTTPS, SRV, PTR

Example: `https://domainnamesystem.pages.dev/resolve?name=google.com&type=A,AAAA`

Response: `{"name":"google.com","status":"NOERROR","queried":["A","AAAA"],"answers":[{"name":"google.com","type":"A","ttl":300,"data":"142.250.x.x"}]}`

IPs for large sites vary by region and time.

## Reading the result

| Result | Meaning | What to do |
|---|---|---|
| `status: NXDOMAIN` | The domain does not exist (definitive) | Check spelling / TLD; do not retry |
| `NOERROR`, empty `answers` | Domain exists, but no records of the `queried` types | Normal for CNAME; try `type=ALL` |
| `status: SERVFAIL` | Resolver could not get an answer (DNSSEC, dead name servers) | Retry later; does not mean the domain is missing |
| `failed: [...]` present | Some types failed while others succeeded | Retry only those types |
| `hint` present | Plain-language explanation of the above | Read it before concluding anything |

HTTP 400 returns `{"error":"...","example":"..."}`; fix the parameters and retry.

## Recipes

- **Does this domain exist?** `type=NS` (or default). `NXDOMAIN` = no.
- **Where does it point?** default set; follow any CNAME in `answers`.
- **Who handles its email?** `type=MX`. Lower preference number = higher priority.
- **SPF:** `type=TXT` on the domain, look for data starting `v=spf1`.
- **DMARC:** `name=_dmarc.<domain>&type=TXT`, look for `v=DMARC1`.
- **DKIM:** `name=<selector>._domainkey.<domain>&type=TXT` (the selector must be known, e.g. `google`).
- **Who may issue certificates?** `type=CAA`. Empty = no restriction.
- **Domain-ownership verification token:** `type=TXT` on the domain (or the specific name the provider asks for).
- **SRV:** `name=_sip._tcp.example.com&type=SRV` (service and protocol labels are part of the name).
- **Reverse lookup (PTR):** reverse the IPv4 octets and append `.in-addr.arpa`: for 192.0.2.10 use `name=10.2.0.192.in-addr.arpa&type=PTR`.

## Other interfaces

- MCP (Streamable HTTP): `https://domainnamesystem.pages.dev/mcp`, tool `dns_lookup {name, type?}`
- A2A (JSON-RPC `message/send`, protocol 0.3.0): `https://domainnamesystem.pages.dev/a2a`. Text such as `MX gmail.com`, or a data part `{"name":"gmail.com","type":"MX"}`.
- OpenAPI: `https://domainnamesystem.pages.dev/openapi.json`
