> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/d/dnsq-api.md).

# DNSQ API

DNSQ is a SaaS DNS security product with agents installed on servers and clients. OctoXLabs uses its public API to add the agents to the inventory.

## Use cases

* List all DNSQ server agents.

```
Adapters = dnsq-api AND Category = Server
```

* Find servers that run a DNSQ agent but are missing from your EDR.

```
Adapters = dnsq-api AND Category = Server AND NOT Adapters = falcon-crowdstrike
```

## Before you begin

### Network

| Source              | Destination                           | Port | Protocol |
| ------------------- | ------------------------------------- | ---- | -------- |
| OctoXLabs connector | `public-api.dns-q.com` (configurable) | 443  | HTTPS    |

### Required permissions

| Scope or role                            | Permission | Needed for |
| ---------------------------------------- | ---------- | ---------- |
| DNSQ API credentials (token and API key) | Read       | Agent list |

## Create credentials in DNSQ

{% stepper %}
{% step %}

### Open API Generation

Log in to the DNSQ console and go to **Settings** > **API Generation**.
{% endstep %}

{% step %}

### Create a key

Create a new API key. This generates the token and the API key (one-time password) together.
{% endstep %}

{% step %}

### Copy both values

Copy both values before you close the dialog. The one-time password is shown only once.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                         | Required | Type                       | Default                | Description                                                                                                      |
| --------------------------------- | -------- | -------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------- |
| Domain                            | Yes      | String                     | `public-api.dns-q.com` | Host of the DNSQ public API, without scheme or trailing slash.                                                   |
| Token                             | Yes      | String                     | None                   | Generated token, sent in the `X-API-Key` header.                                                                 |
| API Key                           | Yes      | String                     | None                   | One-time password generated with the token, sent in the `Authorization` header.                                  |
| Agent type (Server / Client)      | No       | Choice: `Server`, `Client` | Empty (all agents)     | Collect only one agent type.                                                                                     |
| Use agent description as hostname | No       | Boolean                    | `False`                | Use the agent description as host name. Enable only if every description is unique, otherwise agents are merged. |
| Proxy URL                         | No       | String                     | None                   | Proxy, used as `http://<proxy>`.                                                                                 |
| Timeout                           | No       | Integer (seconds)          | `30`                   | Time to wait for API responses.                                                                                  |

## Troubleshooting

| Error message                    | Cause                         | Fix          |
| -------------------------------- | ----------------------------- | ------------ |
| `Max retries exceeded for <url>` | DNSQ kept answering HTTP 429. | Retry later. |

## Change history
