---
title: PowerDNS monitoring integration
source: https://docs.newrelic.com/docs/infrastructure/host-integrations/host-integrations-list/powerdns-monitoring-integration
---

> #### 💡 PREVIEW
>
> We're still working on this feature, but we'd love for you to try it out!
>
> It only applies to the versions starting on [0.0.5](https://github.com/newrelic/newrelic-prometheus-exporters-packages/releases/tag/nri-powerdns-0.0.5) released in October 2021.
>
> This feature is currently provided as part of a preview program pursuant to our [pre-release policies](https://docs.newrelic.com/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy).

Our PowerDNS [integration](https://docs.newrelic.com/docs/integrations/host-integrations/getting-started/introduction-host-integrations)
collects and sends dimensional metrics from [PowerDNS](https://www.powerdns.com). You can view this [metric data](#metrics) in pre-built dashboards, create alert policies, and create custom queries and charts.

Read on to install the integration, and to see what data we collect.

## Compatibility and requirements [#req]

Our integration is compatible with PowerDNS Recursor and Authoritative Server.

Before installing the integration, make sure that you meet the following requirements:

-   [Install the infrastructure agent](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic), minimum version 1.19.2.
-   Linux distribution [compatible with the infrastructure agent](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/getting-started/compatibility-requirements-new-relic-infrastructure#operating-systems).

To get data from PowerDNS infrastructure, our PowerDNS integration uses a third-party [Prometheus exporter](https://github.com/janeczku/powerdns_exporter), which exposes Prometheus metrics on the port specified in the configuration. The integration collects these metrics, transforms them into entities, filters them, and then sends them to New Relic.

To enable the API, the webserver and the HTTP API need to be enabled.

Add these lines to the pdns.conf:

```
api=yes
api-key=changeme
```

And restart, the following examples should start working:

```
curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1/servers/localhost | jq .
curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1
```

For more information, [Enabling Webserver and Api](https://doc.powerdns.com/authoritative/http-api/index.html)

## Install and activate [#install]

To install the PowerDNS integration, choose your setup:

**Linux installation**

1.  Install [the infrastructure agent](https://docs.newrelic.com/docs/integrations/host-integrations/installation/install-infrastructure-host-integrations/#install), and replace the `INTEGRATION_FILE_NAME` variable with `nri-powerdns`.

2.  Change the directory to the integrations folder:

    ```
    cd /etc/newrelic-infra/integrations.d
    ```

3.  Copy of the sample configuration file:

    ```
    sudo cp powerdns-config.yml.sample powerdns-config.yml
    ```

4.  Edit the `powerdns-config.yml` file as described in the [configuration settings](#config).

**Tarball installation (advanced)**

You can also [install the integration from a tarball file](https://docs.newrelic.com/docs/integrations/host-integrations/installation/install-host-integrations-built-new-relic#tarball). This gives you full control over the installation and configuration process.

## Configure the integration [#config]

To configure the integration, edit the config in the integration's YAML configuration file `powerdns-config.yml`.

Use the YAML configuration to place required login credentials and configure how your data is collected, depending on your setup and preference.

Since this integration is based on a prometheus exporter, settings applicable to other integrations, like `interval`, `timeout` or `inventory_source` are not supported.

## PowerDNS instance settings [#instance-settings]

The following configuration options are available:

| Setting            | Description                                                                                                  | Default     |
| ------------------ | ------------------------------------------------------------------------------------------------------------ | ----------- |
| **powerdns_url**   | API URL of the powerdns service                                                                              | N/A         |
| **exporter_port**  | Port to expose scrape endpoint on, If this is not provided a random port will be used to launch the exporter | random-port |
| **scrape_timeout** | Time until a scrape request times out                                                                        | 5s          |
| **api_key**        | API key used to connect to the PowerDNS server                                                               | N/A         |

## Example configurations [#examples]

**Basic configuration**

This is the basic configuration used to collect metrics from an authoritative and a recursor instance:

````
integrations:
  - name: nri-powerdns
    config:
      api_key: authoritative-secret
      exporter_port: 9121
      powerdns_url: http://localhost:8081/api/v1/
  - name: nri-powerdns
    config:
      api_key: recursor-secret
      exporter_port: 9122
      powerdns_url: http://localhost:8082/api/v1/
```

````

## Find and use data [#find-and-use]

For more on how to find and use your data, see [Understand integration data](https://docs.newrelic.com/docs/infrastructure/integrations/find-use-infrastructure-integration-data).

Metrics are attached to the Metric sample and [event types](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/new-relic-data-types#events-new-relic) of the entities `POWERDNS_AUTHORITATIVE` and `POWERDNS_RECURSOR`. You can [query this data](https://docs.newrelic.com/docs/using-new-relic/data/understand-data/query-new-relic-data) for troubleshooting purposes, or to create [custom charts and dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards/).

## Metric data [#metrics]

Two entities are created: `POWERDNS_AUTHORITATIVE` and `POWERDNS_RECURSOR`.

The following dimensional metrics are captured scraping the exporter and linked to the entity `POWERDNS_AUTHORITATIVE`:

| Name                                                          | Description                                                                  | Dimensions |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------- |
| `powerdns_authoritative_uptime (count)`                       | Uptime in seconds of the daemon.                                             | - type     |
| `powerdns_authoritative_packet_cache_size (gauge)`            | Number of entries in the packet cache.                                       |            |
| `powerdns_authoritative_recursive_queries_total (count)`      | Total number of recursive queries by status.                                 | - status   |
| `powerdns_authoritative_remote_queries (count)`               | Remote server IP addresses.                                                  | - remote   |
| `powerdns_authoritative_security_status (gauge)`              | PDNS Server Security status based on `security-status.secpoll.powerdns.com`. |            |
| `powerdns_authoritative_exceptions_total (count)`             | Total number of exceptions by error.                                         | - error    |
| `powerdns_authoritative_latency_average_seconds (gauge)`      | Average number of microseconds a packet spends within PowerDNS.              |            |
| `powerdns_authoritative_dnsupdate_queries_total (count)`      | Total number of DNS update queries by status.                                | - status   |
| `powerdns_authoritative_qsize (gauge)`                        | Number of packets waiting for database attention.                            |            |
| `powerdns_authoritative_response_rcodes (count)`              | Distribution of rcodes.                                                      | - rcode    |
| `powerdns_authoritative_signature_cache_size (gauge)`         | Number of entries in the signature cache.                                    |            |
| `powerdns_authoritative_queries_unauth (count)`               | Queries for domains that we are not authoritative for.                       | - record   |
| `powerdns_authoritative_answers_bytes_total (count)`          | Total number of answer bytes sent over by protocol.                          | - proto    |
| `powerdns_authoritative_queries (count)`                      | UDP Queries Received.                                                        | - record   |
| `powerdns_authoritative_exporter_json_parse_failures (count)` | Number of errors while parsing PowerDNS JSON stats.                          |            |
| `powerdns_authoritative_deferred_cache_actions (count)`       | Deferred cache actions because of maintenance by type.                       | - type     |
| `powerdns_authoritative_up (gauge)`                           | The last scrape of PowerDNS was successful.                                  |            |
| `powerdns_authoritative_query_cache_lookup (count)`           | Query cache lookups by result.                                               | - result   |
| `powerdns_authoritative_key_cache_size (gauge)`               | Number of entries in the key cache.                                          |            |
| `powerdns_authoritative_answers_total (count)`                | Total number of answers by protocol.                                         | - proto    |
| `powerdns_authoritative_packet_cache_lookup (count)`          | Packet cache lookups by result.                                              | - result   |
| `powerdns_authoritative_metadata_cache_size (gauge)`          | Number of entries in the metadata cache.                                     |            |
| `powerdns_authoritative_queries_total (count)`                | Total number of queries by protocol.                                         | - proto    |
| `powerdns_authoritative_cpu_utilisation (count)`              | Number of CPU milliseconds spent in user, and kernel space.                  | - type     |
| `powerdns_authoritative_dnssec (count)`                       | DNSSEC counters.                                                             | - type     |
| `powerdns_authoritative_response_sizes (count)`               | Size distribution of responses.                                              | - size     |
| `powerdns_authoritative_exporter_total_scrapes (count)`       | Current total PowerDNS scrapes.                                              |            |
| `powerdns_authoritative_remote_queries_unauth (count)`        | Remote hosts querying domains for which we are not authoritative.            | - remote   |

The following dimensional metrics are captured scraping the exporter and linked to the entity `POWERDNS_RECURSOR`:

| Name                                                     | Description                                                               | Dimensions |
| -------------------------------------------------------- | ------------------------------------------------------------------------- | ---------- |
| `powerdns_recursor_incoming_queries_total (count)`       | Total number of incoming queries by network.                              | - net      |
| `powerdns_recursor_outgoing_queries_total (count)`       | Total number of outgoing queries by network.                              | - net      |
| `powerdns_recursor_cache_size (gauge)`                   | Number of entries in the cache.                                           |            |
| `powerdns_recursor_cache_lookups_total (count)`          | Total number of cache lookups by result.                                  | - result   |
| `powerdns_recursor_exporter_json_parse_failures (count)` | Number of errors while parsing PowerDNS JSON stats.                       |            |
| `powerdns_recursor_answers_rcodes_total (count)`         | Total number of answers by response code.                                 | - rcode    |
| `powerdns_recursor_exporter_total_scrapes (count)`       | Current total PowerDNS scrapes.                                           |            |
| `powerdns_recursor_concurrent_queries (gauge)`           | Number of concurrent queries.                                             |            |
| `powerdns_recursor_answers_rtime_total (count)`          | Total number of answers grouped by response time slots.                   | - timeslot |
| `powerdns_recursor_latency_average_seconds (gauge)`      | Exponential moving average of question-to-answer latency.                 |            |
| `powerdns_recursor_exceptions_total (count)`             | Total number of exceptions by error.                                      | - error    |
| `powerdns_recursor_response_time_seconds_sum (count)`    | Histogram of PowerDNS recursor response times in seconds. (sum metric)    |            |
| `powerdns_recursor_response_time_seconds_bucket (count)` | Histogram of PowerDNS recursor response times in seconds. (bucket metric) | - le       |
| `powerdns_recursor_up (gauge)`                           | The last scrape of PowerDNS was successful.                               |            |

## Check the source code [#source-code]

This integration is open source software. This means you can [browse its source code](https://github.com/newrelic/newrelic-prometheus-exporters-packages) and send improvements, or create your own fork and build it.

Moreover this integration leverages an opensource exporter created by the community.
