> 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.md).

# DNSQ

dnsq is a self-hosted DNS lookup server. OctoXLabs sends it a list of domains and adds the returned DNS records to the inventory. The list comes from a file on the connector host, from the Hosts field, or both.

## Use cases

* Keep an up to date view of the DNS records of your domain list.
* Compare what several nameservers answer for the same domain, using the Nameservers field.

## Before you begin

### Network

| Source              | Destination | Port                | Protocol                                 |
| ------------------- | ----------- | ------------------- | ---------------------------------------- |
| OctoXLabs connector | dnsq server | 8080 (configurable) | HTTPS if Is secure is on, HTTP otherwise |

dnsq serves plain HTTP on 8080 by default. Turn off Is secure unless a TLS proxy fronts the server. In Kubernetes, use the service DNS name as the IP or host name.

### Required permissions

| Scope or role | Permission | Needed for                   |
| ------------- | ---------- | ---------------------------- |
| None          | None       | dnsq needs no authentication |

The connector must be able to read the domain list file in `/opt/octoxlabs/connector/media/dnsq`.

## Create credentials in dnsq

{% stepper %}
{% step %}

### Start the server

Run the dnsq server with `dnsq server`.
{% endstep %}

{% step %}

### Place the domain file

Copy the file to `/opt/octoxlabs/connector/media/dnsq` on the connector host. Enter only the file name in OctoXLabs. Supported formats are CSV and XLSX (header row, one domain per row), JSON (list of objects or list of strings) and XML (repeated elements with a child tag for the domain).
{% endstep %}

{% step %}

### Or use the Hosts field

Enter a comma separated list of domains. If you also give a file, both lists are merged and de-duplicated.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                        | Required                    | Type                          | Default | Description                                                                                         |
| -------------------------------- | --------------------------- | ----------------------------- | ------- | --------------------------------------------------------------------------------------------------- |
| IP or Hostname                   | Yes                         | String                        | None    | IP or host name of the dnsq server, for example `dnsq.internal.company.com`.                        |
| Filename                         | Needed if Hosts is empty    | String (file name or pattern) | None    | Domain list file in the dnsq media folder.                                                          |
| Domain field (column/key)        | No                          | String                        | `name`  | Column, key or XML tag with the domain. Dot notation works for nested JSON keys.                    |
| Hosts                            | Needed if Filename is empty | String                        | None    | Comma separated domains, for example `www.example.com,portal.example.net`.                          |
| Port                             | No                          | Integer                       | `8080`  | dnsq port.                                                                                          |
| Is secure                        | No                          | Boolean                       | `True`  | HTTPS when on, HTTP when off.                                                                       |
| CSV separator                    | No                          | String (1 character)          | `,`     | Delimiter for CSV files.                                                                            |
| Nameservers                      | No                          | String                        | Empty   | Comma separated nameservers to query, for example `8.8.8.8,1.1.1.1`. Empty uses the server default. |
| Include default nameserver       | No                          | Boolean                       | `True`  | Also query the server default nameserver.                                                           |
| Include AAAA (IPv6) records      | No                          | Boolean                       | `False` | Also resolve AAAA records.                                                                          |
| Domains per request (batch size) | No                          | Integer                       | `100`   | Domains per dnsq request.                                                                           |
| Timeout                          | No                          | Integer (seconds)             | `30`    | Request timeout.                                                                                    |

## Troubleshooting

| Error message                                               | Cause                                               | Fix                                                                      |
| ----------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------ |
| `Provide a file (filename) or a hosts list.`                | Both Filename and Hosts are empty.                  | Fill in at least one.                                                    |
| `No domains to resolve.`                                    | The list is empty after reading the file and Hosts. | Check the file name, the Domain field and the content.                   |
| `File not found with this pattern.`                         | The file is not in the dnsq media folder.           | Place the file in `/opt/octoxlabs/connector/media/dnsq`.                 |
| `Unsupported file type: <ext>`                              | The file is not CSV, XLSX, JSON or XML.             | Convert the file.                                                        |
| `dnsq lookup failed for every batch (<n> domains): <error>` | Every dnsq request failed.                          | Check the server, port, Is secure and the timeout. Lower the batch size. |

## Change history

{% hint style="info" %}
Available starting from version 6.6.1.
{% endhint %}
