# DNS Lookup (`dns.lookup`)

Live DNS records of a domain: A, AAAA, CNAME, MX, NS, TXT, SOA, CAA and SRV, resolved from our server through public resolvers.

- **Route:** `POST /v1/run/dns.lookup`
- **Price:** $0.0005 per request ($0.50 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs network checks (`netcheck`) · failover: no
- **Measured latency:** p50 23 ms · p95 23 ms · p99 23 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `domain` | string | yes |  | Domain or host name |
| `types` | array | no | [] | Record types; default A, AAAA, CNAME, MX, NS, TXT |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `exists` | False when the name does not exist (NXDOMAIN). |
| `records` | Records per type; MX carries priority, SOA and CAA their fields. |
| `record_count` | Total records returned. |
| `queried_types` | Types that were queried. |
| `errors` | Types the resolver could not answer. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/dns.lookup \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"github.com","types":["A","MX","TXT"]}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('dns.lookup', {'domain': 'github.com', 'types': ['A', 'MX', 'TXT']})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run dns.lookup '{"domain":"github.com","types":["A","MX","TXT"]}'
```

Quote first (free, validates input): `POST /v1/quote/dns.lookup` with the same body.
