# DNS Lookup API
> Resolve DNS records — A, AAAA, MX, NS, TXT, CNAME, SOA, SRV, CAA, PTR — for any domain, fetch all common records in a single call, or run a reverse PTR lookup for an IPv4 address. Backed by Google DNS-over-HTTPS. Ideal for devops tooling, uptime and email-deliverability checks (SPF/DKIM/DMARC), security research and domain monitoring.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/dns-api/..."
```

## Pricing
- **Free** (Free) — 1,500 calls/Mo, 2 req/s
- **Basic** ($12/Mo) — 120,000 calls/Mo, 8 req/s
- **Pro** ($34/Mo) — 600,000 calls/Mo, 25 req/s
- **Mega** ($89/Mo) — 2,500,000 calls/Mo, 80 req/s

## Endpoints

### DNS

#### `GET /v1/lookup` — Records of one type

**Parameters:**
- `domain` (query, required, string) — Domain name Example: `example.com`
- `type` (query, optional, string) — A AAAA MX NS TXT CNAME SOA SRV CAA PTR Example: `A`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dns-api/v1/lookup?domain=example.com&type=A"
```

**Response:**
```json
{
    "data": {
        "type": "A",
        "domain": "example.com",
        "status": "NOERROR",
        "answers": [
            {
                "ttl": 252,
                "data": "172.66.147.243",
                "name": "example.com",
                "type": "A"
            },
            {
                "ttl": 252,
                "data": "104.20.23.154",
                "name": "example.com",
                "type": "A"
            }
        ],
        "records": [
            {
                "ttl": 252,
                "data": "172.66.147.243",
                "name": "example.com",
                "type": "A"
            },
            {
                "ttl": 252,
                "data": "104.20.23.154",
                "name": "example.com",
                "type": "A"
            }
        ],
        "authoritative": true
    },
    "meta": {
        "timestamp": "2026-05-30T04:09:46.681Z",
        "request_id": "ec5d38c8-f100-4383-8113-36a45cd978bf"
    },
    "status": "ok",
    "message": "DNS lookup completed",
    "success": true
}
```

#### `GET /v1/records` — All common records

**Parameters:**
- `domain` (query, required, string) — Domain name Example: `example.com`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dns-api/v1/records?domain=example.com"
```

**Response:**
```json
{
    "data": {
        "domain": "example.com",
        "records": {
            "A": [
                {
                    "ttl": 251,
                    "data": "104.20.23.154",
                    "name": "example.com",
                    "type": "A"
                },
                {
                    "ttl": 251,
                    "data": "172.66.147.243",
                    "name": "example.com",
                    "type": "A"
                }
            ],
            "MX": [
                {
                    "ttl": 225,
                    "data": "0 .",
                    "name": "example.com",
                    "type": "MX"
                }
            ],
            "NS": [
                {
                    "ttl": 21600,
                    "data": "hera.ns.cloudflare.com.",
                    "name": "example.com",
                    "type": "NS"
                },
                {
                    "ttl": 21600,
                    "data": "elliott.ns.cloudflare.com.",
                    "name": "example.com",
                    "type": "NS"
                }
            ],
            "TXT": [
                {
                    "ttl": 300,
                    "data": "_k2n1y4vw3qtb4skdx9e7dxt97qrmmq9",
                    "name": "example.com",
                    "type": "TXT"
                },
                {
                    "ttl": 300,
                    "data": "v=spf1 -all",
                    "name": "example.co
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/reverse` — Reverse PTR for an IPv4

**Parameters:**
- `ip` (query, required, string) — IPv4 address Example: `8.8.8.8`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/dns-api/v1/reverse?ip=8.8.8.8"
```

**Response:**
```json
{
    "data": {
        "ip": "8.8.8.8",
        "status": "NOERROR",
        "hostnames": [
            "dns.google"
        ]
    },
    "meta": {
        "timestamp": "2026-05-30T04:09:48.119Z",
        "request_id": "0b6bcf09-759b-4618-8a7e-d7ac5ed317b0"
    },
    "status": "ok",
    "message": "Reverse DNS completed",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/dns-api
OpenAPI spec: https://www.oanor.com/api/dns-api/openapi.json
