# DNS lookup API

See every DNS record for a domain, where its mail goes and whether it's DNSSEC-signed, straight from the source.

`GET /v1/dns`

- Price: Costs 1 credit per call; cached answers cost the same. Calls that fail upstream (502) are free.
- Cache: Answers are cached for the lowest record TTL, between 1 minute and 1 hour; send fresh=true to ask the source again.
- MCP tool: `lookup_dns`

Records for a domain grouped by type, with TTLs, CNAME chain, DNSSEC state and findings. Costs 1 credit per call; cached answers cost the same. Calls that fail upstream (502) are free. Answers are cached for the lowest record TTL, between 1 minute and 1 hour; send fresh=true to ask the source again. A retry with the same `X-Request-Id` returns the stored result of the first call for 24 hours without charging again, marked with the `X-Replayed: true` header.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `domain` | string | yes | A domain name or a URL |
| `types` | string or null | no | Comma-separated record types; default A, AAAA, CNAME, MX, NS, TXT, SOA, CAA |
| `fresh` | boolean | no | Skip the cache and ask DNS again |

## Response

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `tool` | string | yes |  |
| `target` | string | yes |  |
| `status` | "ok" | "partial" | "error" | yes |  |
| `fetched_at` | string | no |  |
| `cached` | boolean | no |  |
| `credits_used` | integer | no | Credits this call took from your balance. 0 for free tools, for a replay of an earlier call, and for a free check run on the website without signing in |
| `summary` | string | yes |  |
| `score` | integer or null | no |  |
| `findings` | array of object | no |  |
| `credits_remaining` | integer | yes | Your balance after this call. It can be below zero after a refund; free tools still work then |
| `data` | object | yes | This tool's result |
| `data.name` | string | yes | The name looked up, in ASCII form |
| `data.unicode` | string | yes | The same name for display |
| `data.nxdomain` | boolean | yes |  |
| `data.dnssec` | "secure" | "insecure" | "bogus" | "indeterminate" | yes |  |
| `data.wildcard` | boolean | yes |  |
| `data.wildcard_source` | "rrsig" | "probe" or null | no |  |
| `data.records` | object | yes | Rows per requested record type |
| `data.query_status` | object | yes | Query outcome per requested record type |
| `data.cname_chain` | array of object | no |  |
| `data.cname_chain.name` | string | yes |  |
| `data.cname_chain.target` | string | yes |  |
| `data.cname_chain.ttl` | integer | yes |  |
| `data.hosts` | object | no |  |
| `data.negative_ttl` | integer or null | no |  |
| `data.min_ttl` | integer or null | no |  |

## Errors

- `400` Invalid domain, URL or parameter, a TLD this tool can't check, or an X-Request-Id already used for another call (`invalid_domain`, `invalid_url`, `invalid_request`, `unsupported_tld`)
- `401` Missing, unknown or revoked API key, or one whose creator is no longer a member of the account (`unauthorized`)
- `402` Balance below the call's price (`insufficient_credits`)
- `403` Account suspended, the key's creator is over the plan's seats, or an anonymous check without a valid proof-of-work or for a tool that needs an account, or bulk checks before a first purchase (`account_suspended`, `plan_limit`, `challenge_required`, `sign_in_required`, `bulk_locked`)
- `429` Too many requests, today's free checks are used up, or too many website scans at once; wait for the number of seconds in the Retry-After header (`rate_limited`, `free_limit_reached`, `too_many_jobs`). Not charged
- `500` Unexpected error (`internal_error`)
- `502` Every upstream source failed; not charged (`source_unavailable`). A Retry-After header says how long to wait when the source asked us to

## Example

```sh
curl "https://api.dnssuper.com/v1/dns?domain=example.com&types=A,MX" \
  -H "Authorization: Bearer $DNSSUPER_API_KEY"
```

```python
import os

import httpx

client = httpx.Client(
    base_url="https://api.dnssuper.com",
    headers={"Authorization": f"Bearer {os.environ['DNSSUPER_API_KEY']}"},
    timeout=60,
)
response = client.get("/v1/dns", params={
    "domain": "example.com",
    "types": "A,MX",
})
response.raise_for_status()
result = response.json()
print(result["summary"], result["credits_used"])
```

```ts
const response = await fetch(`https://api.dnssuper.com/v1/dns?${new URLSearchParams({"domain":"example.com","types":"A,MX"})}`, {
  headers: { Authorization: `Bearer ${process.env.DNSSUPER_API_KEY}` },
});
if (!response.ok) throw new Error((await response.json()).error.message);
const result = await response.json();
console.log(result.summary, result.credits_used);
```

Example response:

```json
{
  "tool": "dns-lookup",
  "target": "example.com",
  "status": "ok",
  "fetched_at": "2026-11-14T10:00:00Z",
  "cached": false,
  "credits_used": 1,
  "summary": "example.com resolves to 2 IPv4 addresses and receives mail through 1 MX host.",
  "findings": [
    {
      "id": "dns.dnssec_unsigned",
      "severity": "info",
      "title": "Your domain isn't signed with DNSSEC",
      "detail": "Answers for example.com carry no DNSSEC signatures, so resolvers can't check that nobody changed them on the way.",
      "fix": "Turn on DNSSEC at your DNS provider, then add the DS record it gives you at your registrar. Many providers do both for you in one step."
    }
  ],
  "data": {
    "name": "example.com",
    "unicode": "example.com",
    "nxdomain": false,
    "dnssec": "insecure",
    "wildcard": false,
    "records": {
      "A": [
        {
          "name": "example.com",
          "ttl": 300,
          "value": "192.0.2.10"
        },
        {
          "name": "example.com",
          "ttl": 300,
          "value": "192.0.2.11"
        }
      ],
      "MX": [
        {
          "name": "example.com",
          "ttl": 3600,
          "value": "10 mail.example.com"
        }
      ]
    },
    "query_status": {
      "A": "ok",
      "MX": "ok"
    },
    "cname_chain": [],
    "hosts": {
      "mail.example.com": {
        "A": [
          "192.0.2.25"
        ],
        "AAAA": [],
        "roles": [
          "MX"
        ],
        "status": "ok"
      }
    },
    "caa_inherited": [],
    "min_ttl": 300
  },
  "credits_remaining": 498
}
```

## MCP

```json
{
  "tool": "lookup_dns",
  "arguments": {
    "domain": "example.com",
    "types": "A,MX"
  }
}
```

```text
example.com resolves to 2 IPv4 addresses and receives mail through 1 MX host.
A: 192.0.2.10, 192.0.2.11 (TTL 300)
MX: 10 mail.example.com (TTL 3600)
DNSSEC: insecure
- info: Your domain isn't signed with DNSSEC
Credits: 1 credit used, 498 remaining | fresh | checked 2026-11-14 10:00 UTC
```
