# DNS Lookup API

> Returns DNS records of a domain, including A, MX, TXT, NS, CAA, SOA and DNSKEY, and reverse DNS names of IPs.

Category: Utilities. Region: global. 11 endpoints at `https://api.hoshime.com/v1/dnslookup/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/dnslookup
## GET /v1/dnslookup/lookup

DNS records of a domain (A, AAAA, MX, TXT, NS or CNAME).

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. gmail.com) |
| `type` | string | no | Record type: A, AAAA, MX, TXT, NS or CNAME. (one of A, AAAA, MX, TXT, NS, CNAME, SOA, CAA, DNSKEY, DS, HTTPS; default A; e.g. MX) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/lookup?name=gmail.com&type=MX" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/reverse

The PTR (reverse DNS) name of a public IP address.

Scope: `social:read` · Units: 1 · Cached: 30 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `ip` | string | yes | Public IPv4 or IPv6 address. (e.g. 8.8.8.8) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/reverse?ip=8.8.8.8" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/records

The common records of a domain in one answer: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA and HTTPS.

Scope: `social:read` · Units: 9 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. example.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `lookups` (Lookup[]), `lookups[].name` (string), `lookups[].provider` (string), `lookups[].records` (Record[]), `lookups[].status` (string), `lookups[].type` (string), `lookups[].validated` (boolean), `name` (string), `provider` (string)

```bash
curl "https://api.hoshime.com/v1/dnslookup/records?name=example.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/caa

CAA records: the certificate authorities that may issue for a domain.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. google.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/caa?name=google.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/soa

SOA record of a zone: primary name server, contact and timers.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. example.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/soa?name=example.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/dnskey

DNSSEC DNSKEY records of a zone (keys signing its records).

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. example.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/dnskey?name=example.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/ds

DS records the parent zone publishes for a signed zone (DNSSEC chain of trust).

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. example.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/ds?name=example.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/https

HTTPS service binding records: ALPN protocols and address hints.

Scope: `social:read` · Units: 1 · Cached: 5 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. example.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/https?name=example.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/srv

SRV records of a service on a domain, such as the IMAPS server of gmail.com.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `service` | string | yes | Service label without the underscore, such as imaps, submission or caldavs. (e.g. imaps) |
| `proto` | string | yes | Transport protocol: tcp or udp. (one of tcp, udp; e.g. tcp) |
| `domain` | string | yes | Domain name that publishes the service, such as gmail.com. (e.g. gmail.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/srv?service=imaps&proto=tcp&domain=gmail.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/mailAuth

The email sender policies of a domain: its SPF record and DMARC policy, with the handling each one asks for.

Scope: `social:read` · Units: 2 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. gmail.com) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `dmarc` (string), `dmarcPolicy` (string), `dmarcSubdomainPolicy` (string), `name` (string), `provider` (string), `spf` (string), `spfAll` (string)

```bash
curl "https://api.hoshime.com/v1/dnslookup/mailAuth?name=gmail.com" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/dnslookup/dkim

The DKIM public key of a domain for one selector: the TXT record that verifies the mail the domain signs.

Scope: `social:read` · Units: 1 · Cached: 60 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | Domain name, such as example.com. (e.g. gmail.com) |
| `selector` | string | yes | DKIM selector the mail is signed with, such as 20230601 or selector1; the s= tag of a DKIM-Signature header. (e.g. 20230601) |
| `provider` | string | no | Resolver: google or cloudflare. (one of google, cloudflare; default google) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `name` (string), `provider` (string), `records` (Record[]), `records[].data` (string), `records[].name` (string), `records[].ttl` (integer (int64)), `records[].type` (string), `status` (string), `type` (string), `validated` (boolean)

```bash
curl "https://api.hoshime.com/v1/dnslookup/dkim?name=gmail.com&selector=20230601" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
