# DNS

GET /lookup/dns: Resolves the current DNS records of a domain or hostname in real time. Request up to five record types in one call.

Source: https://docs.deepinfo.com/reference/lookup/dns/

Last updated: 2026-09-27

---
`GET https://api.deepinfo.com/v1/lookup/dns`

Resolves the **current** DNS records of a domain or hostname in real time. Request up to five record types in one call. Each request uses **one quota unit**, whether you ask for one type or five.

## Authentication

Send your API key in the `apikey` request header.

## Query Parameters

| Parameter | Required | Description | Example |
|---|---|---|---|
| `domain` | Required | Fully qualified domain name, e.g. `deepinfo.com` or `www.deepinfo.com`. IP addresses are not accepted. | `deepinfo.com` |
| `type` | Required | DNS record type names, comma-separated, for example `A,MX`. Up to **5** types per request. | `A,MX` |

## Response Fields

| Field | Description |
|---|---|
| `fqdn` | The queried name |
| `requested_types` | Record types that were requested |
| `responses[]` | One entry per requested type |
| `responses[].type` | Record type |
| `responses[].conn_status` | `success` or `timeout` |
| `responses[].rcode` | DNS response code, for example `NOERROR` or `NXDOMAIN` |
| `responses[].values` | Parsed record values |
| `responses[].raw` | The answer in zone-file format |
| `responses[].server` | Resolver used |
| `servers` | Resolvers used for the lookup |
| `check_date` | When the lookup was performed (UTC) |

## Response Schema

_Inferred from examples._ Built from the saved 2xx example response: the fields it contains, with the types seen there. It is not a contract.

| Field | Type |
|---|---|
| `fqdn` | string |
| `requested_types` | array<string> |
| `responses` | array<object> |
| `responses[].type` | string |
| `responses[].conn_status` | string |
| `responses[].rcode` | string |
| `responses[].raw` | string |
| `responses[].values` | array<string> |
| `responses[].server` | string |
| `servers` | array<string> |
| `check_date` | string |

## Errors

`400` if `domain` is not a valid FQDN or `type` is missing.

## Examples

### 200 · A and MX Records

```bash
curl 'https://api.deepinfo.com/v1/lookup/dns?domain=deepinfo.com&type=A%2CMX' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json'
```

`Content-Type: application/json` · `deepinfo-request-id: 5f0c6a8e-1b2d-4c3e-9f4a-7b8c9d0e1f2a`

```json
{
  "fqdn": "deepinfo.com",
  "requested_types": [
    "A",
    "MX"
  ],
  "responses": [
    {
      "type": "A",
      "conn_status": "success",
      "rcode": "NOERROR",
      "raw": "deepinfo.com. 300 IN A 104.26.11.21\ndeepinfo.com. 300 IN A 104.26.10.21\ndeepinfo.com. 300 IN A 172.67.70.198",
      "values": [
        "104.26.10.21",
        "104.26.11.21",
        "172.67.70.198"
      ],
      "server": "8.8.8.8"
    },
    {
      "type": "MX",
      "conn_status": "success",
      "rcode": "NOERROR",
      "raw": "deepinfo.com. 300 IN MX 10 alt4.aspmx.l.google.com.\ndeepinfo.com. 300 IN MX 5 alt2.aspmx.l.google.com.\ndeepinfo.com. 300 IN MX 10 alt3.aspmx.l.google.com.\ndeepinfo.com. 300 IN MX 5 alt1.aspmx.l.google.com.\ndeepinfo.com. 300 IN MX 1 aspmx.l.google.com.",
      "values": [
        "1 aspmx.l.google.com",
        "5 alt1.aspmx.l.google.com",
        "5 alt2.aspmx.l.google.com",
        "10 alt3.aspmx.l.google.com",
        "10 alt4.aspmx.l.google.com"
      ],
      "server": "8.8.8.8"
    }
  ],
  "servers": [
    "8.8.8.8"
  ],
  "check_date": "2026-09-22T12:25:59Z"
}
```

## Worked Examples

Worked examples of this endpoint, each on its own page with the exact request and its response: [DNS Lookup Examples](/reference/lookup/dns/examples/).

- [A Records of a Domain](/reference/lookup/dns/examples/type-a/): The A records of deepinfo.com: the IPv4 addresses the domain points to, in responses[].values.
- [MX Records: Mail Servers](/reference/lookup/dns/examples/type-mx/): The MX records of gmail.com: its mail servers with their priorities, lowest (preferred) first.
- [IPv4 and IPv6 Addresses Together](/reference/lookup/dns/examples/types-a-aaaa/): A and AAAA of cloudflare.com in one request: one entry per type in responses[].
- [Five Types at Once](/reference/lookup/dns/examples/five-types/): Five record types of deepinfo.com in one request: A, AAAA, MX, NS and TXT, one responses[] entry each.
