PUQ Mautic

PowerDNS setup (HTTP API)

PowerDNS module WHMCS

Order now | Download | Community

The module communicates with your PowerDNS authoritative server via its built-in HTTP API. Before WHMCS can provision and manage DNS zones, you must enable the HTTP API and define an API key on your PowerDNS server.


1. Enable the HTTP API in PowerDNS

Open your PowerDNS main configuration file (typically /etc/powerdns/pdns.conf or a dedicated snippet file under /etc/powerdns/pdns.d/):

# Enable the built-in webserver and HTTP API
webserver=yes
webserver-address=0.0.0.0
webserver-port=8081
webserver-allow-from=0.0.0.0/0
api=yes
api-key=YOUR_SECRET_API_KEY_HERE

Configuration Parameters:

Restart the PowerDNS service to apply the configuration:

systemctl restart pdns

2. Verify the HTTP API

From your WHMCS host (or any permitted workstation), test connectivity and authorization using curl:

curl -s -H 'X-API-Key: YOUR_SECRET_API_KEY_HERE' \
  http://YOUR_PDNS_HOST:8081/api/v1/servers/localhost | jq .

A successful response will return a JSON object with server attributes, including the version string:

{
  "type": "Server",
  "id": "localhost",
  "url": "/api/v1/servers/localhost",
  "daemon_type": "authoritative",
  "version": "4.8.4",
  "zones_url": "/api/v1/servers/localhost/zones{/zone}"
}

This is the exact API endpoint WHMCS verifies when you click the Test Connection button.


3. Master and Zone Behavior Notes


Revision #4
Created 17 November 2026 19:45:55 by Ruslan
Updated 17 November 2026 20:06:31 by Ruslan