PUQ Mautic

PowerDNS WHMCS Module

WHMCS server module for reselling PowerDNS DNS zone management via the PowerDNS HTTP API. Supports configurable zone quotas, 25 DNS record types with allowed-type presets, SOA defaults, name servers, regex blacklists, zone templates, admin server sync, and full WHMCS lifecycle automation.

Description

PowerDNS module WHMCS

Order now | Download | Community

PowerDNS WHMCS module

The PowerDNS WHMCS module transforms your WHMCS installation into a complete, self-service DNS hosting platform. Sell DNS zone management as an independent product or package: each client service grants a configurable quota of DNS zones, allowing clients to create, edit, and delete their DNS zones and records directly from the WHMCS client area. All record updates, additions, and deletions are synchronized in real time with your authoritative PowerDNS server via its high-performance HTTP API.

Administrators maintain complete control over provisioning policies: set maximum zone limits per product package, enforce provider-wide SOA record defaults, assign authoritative name servers, define regex-based blacklists for forbidden domain names, configure auto-provisioned zone templates, and restrict the specific DNS record types clients are permitted to create or edit. The module natively adheres to the WHMCS service lifecycle — suspending a service removes zones from the active DNS server while preserving records in WHMCS, and terminating a service safely cleans up all zone data.


Main features


System requirements

Requirement Minimum
WHMCS 8.x+, 9.x+
PHP 7.4, 8.1, 8.2, 8.3, 8.4
ionCube Loader v15+
PowerDNS Authoritative 4.x+ with HTTP API enabled


Screenshots

Client Area — DNS Zones Dashboard

Client Area — DNS Zones Dashboard client-overview.png

Client Area — DNS Records Management

Client Area — DNS Records Management client-records-table.png

Admin Area — Product Module Settings

Admin Area — Product Module Settings admin-product-module-settings.png

Admin Area — Service Zones Management

Admin Area — Service Zones Management admin-service-zones.png

Changelog

PowerDNS module WHMCS

Order now | Download | Community

v4.0.0 — 16-11-2026

Major architecture update for ionCube 15 compatibility, modern Guzzle HTTP client integration, PUQ UI Toolkit client area upgrade, automated product settings migration, and enhanced security standards.

Architecture & Compatibility

Client Area & UI Toolkit

Settings & Provisioning


v3.0

Full rewrite onto the unified PUQ WHMCS module skeleton.

Installation and Configuration Guide

Step-by-step instructions for installing and configuring the PowerDNS WHMCS module: preparing the PowerDNS server and its HTTP API, installing or updating the module in WHMCS, adding the PowerDNS server, and configuring the product (zone quota, SOA defaults, name servers, blacklist and zone template).

Installation and Configuration Guide

WHMCS Installation and Update

PowerDNS module WHMCS

Order now | Download | Community

System requirements

Requirement Minimum
WHMCS 8.x+, 9.x+
PHP 7.4, 8.1, 8.2, 8.3, 8.4
ionCube Loader v15+
PowerDNS Authoritative 4.x+ with HTTP API enabled

Note: The module uses ionCube encoding. Make sure ionCube Loader v15 or newer is installed and active on your server.


Installation

Note: The module uses ionCube 15, providing universal support across PHP 7.4 through PHP 8.4.

All versions can be found at this link:
https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-PowerDNS/

Older module versions for WHMCS 8 are available in the archive directory:
https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-PowerDNS/archive/

  1. Download the latest release from the PUQ download repository:

    wget https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-PowerDNS/PUQ_WHMCS-PowerDNS-latest.zip
    
  2. Unpack the downloaded archive:

    unzip PUQ_WHMCS-PowerDNS-latest.zip
    
  3. Upload the puqPowerDNS folder into the modules/servers/ directory of your WHMCS installation:

    cp -r puqPowerDNS /path/to/whmcs/modules/servers/
    
  4. Ensure proper ownership and permissions for your web server user (www-data, nginx, or apache):

    chown -R www-data:www-data /path/to/whmcs/modules/servers/puqPowerDNS/
    chmod -R 755 /path/to/whmcs/modules/servers/puqPowerDNS/
    
  5. The module files are now in place. On first load in WHMCS, the automated migration engine will construct all required tables (puqPowerDNS_zones, puq_license, puq_module_versions). No manual SQL execution is needed.


Update

The update procedure consists of replacing existing module files with the newly downloaded release:

  1. Back up your WHMCS database and modules/servers/puqPowerDNS/ directory.
  2. Download and unzip the latest release package.
  3. Overwrite the files in modules/servers/puqPowerDNS/ with the new version files.
  4. Access any page in the WHMCS Admin Area. The module migration runner will automatically apply pending schema upgrades and log the new version in puq_module_versions.
  5. Upgrading from legacy v2.x/v3.x releases is completely safe: existing product configurations are automatically migrated into the unified settings structure.
Installation and Configuration Guide

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

Installation and Configuration Guide

Add Server in WHMCS

PowerDNS module WHMCS

Order now | Download | Community

Register your PowerDNS authoritative server within WHMCS so products can provision against its HTTP API.


1. Add New Server

  1. In the WHMCS Admin Area, navigate to System Settings → Servers (or Setup → Products/Services → Servers).
  2. Click Add New Server.
  3. Fill in the primary server details:
    • Name: A descriptive label for the server (e.g., PowerDNS Cluster 1).
    • Hostname: The fully qualified domain name or IP address of the PowerDNS server (e.g., pdns-test.puq.info).
    • IP Address: The IP address of the PowerDNS API endpoint (optional if hostname resolves).
    • Max No. of Accounts: Maximum accounts assigned to this server (e.g., 200).

Admin Server Setup admin-server-setup.png


2. Server Details and API Credentials

Scroll down to the Server Details section:

Field Required Description
Type (Module) Yes Select PUQ PowerDNS from the dropdown list.
Username No Leave blank. PowerDNS HTTP API authentication does not use HTTP Basic usernames.
Password Yes Enter your PowerDNS api-key (from pdns.conf). The module transmits this via the X-API-Key HTTP header.
Secure Optional Check Tick to use SSL Mode for Connections if PowerDNS API is secured with HTTPS.
Access Hash No Leave blank.

Port Configuration:


3. Verify Connection

  1. Click the Test Connection button.
  2. The module calls GET /api/v1/servers/localhost on your PowerDNS server.
  3. Upon success, WHMCS displays a green notification:
    "Success! The test connection was successful."
  4. Click Save Changes to commit the server configuration.

Admin Server Details & Test Connection admin-server-details-test-connection.png


4. Server Groups (Optional)

If you operate multiple PowerDNS nodes or clusters:

  1. Navigate to System Settings → Servers → Create New Group.
  2. Create a Server Group (e.g., PowerDNS US Cluster), choose your fill method (Add to least full server, or Fill active server until full), and add your PowerDNS servers.
  3. Assign this server group to your products under Module Settings.
Installation and Configuration Guide

Product Configuration

PowerDNS module WHMCS

Order now | Download | Community

Create and configure DNS hosting products using the PUQ PowerDNS provisioning module. All product-level policies, quotas, record filters, and templates are managed under the product's Module Settings tab.


1. Create Product in WHMCS

  1. In the WHMCS Admin Area, navigate to System Settings → Products/Services → Create a New Product.
  2. Select Product Type: Other (or Shared Hosting / Server/VPS).
  3. Enter the Product Name (e.g., DNS Hosting Premium), assign a Product Group, and configure pricing.
  4. Switch to the Module Settings tab.
  5. In Module Name, select PUQ PowerDNS.
  6. Under Server Group (or individual server), choose your PowerDNS server.
  7. Enter your License key in the designated field.
  8. The unified module configuration form loads automatically beneath the standard fields.

Admin Product Module Settings admin-product-module-settings.png


2. Restrictions Configuration

The Restrictions panel defines client boundaries, zone quotas, and permissible DNS record types:

Setting Type Description
Max zones Integer Maximum number of DNS zones the client can create for this service. Enter 0 for unlimited zones.
Edit SOA Dropdown Yes allows clients to edit the SOA email and TTL from the client area. No locks the SOA record.
Allowed record types Text / Badges Comma-separated list of permitted record types (e.g., A, AAAA, CNAME, MX, TXT). If left completely empty, all supported record types (plus SOA if Edit SOA is enabled) are permitted.
Zone name filter Textarea Regular expressions (one per line) matched against prospective zone names. If a submitted domain matches any regex, creation is blocked. Example: /(^|\.)internal\.corp$/i.

Allowed Record Types & Quick Presets:

To streamline configuration, the interface provides quick preset buttons and interactive clickable badges:

When restricted, the client area dynamically limits both the Add Record dropdown menu and client-side table filters, and enforces strict backend authorization before persisting records.

Admin Product Restrictions admin-product-restrictions.png


3. SOA Defaults

The SOA defaults panel defines the default parameters populated into the Start of Authority (SOA) record for every newly generated zone:

Field Default Value Purpose
Zone administrator email admin@example.com RNAME field of the SOA record (dots replaced automatically).
Update interval (refresh) 86400 (24h) Frequency in seconds that secondary name servers query the master for changes.
Retry interval 7200 (2h) Frequency in seconds secondary name servers wait before retrying after a failed refresh.
Expiry time 3600000 (~41 days) Expiry window in seconds after which secondary servers stop answering authoritative queries if the master is unreachable.
Minimum lifetime 3600 (1h) Negative caching TTL for NXDOMAIN responses.

Admin Product SOA Defaults admin-product-soa-defaults.png


4. Name Servers

Specify up to four authoritative name servers (Name server 1 through Name server 4):

Admin Product Name Servers admin-product-nameservers.png


5. Zone Template

The Zone template allows providers to automatically populate standard DNS boilerplate records whenever a client creates a new zone.

Example Template:

@ A 3600 198.51.100.10
www CNAME 3600 {zone}
@ MX 3600 10 mail.{zone}
mail A 3600 198.51.100.25
@ TXT 3600 "v=spf1 mx a ~all"

Admin Product Zone Template admin-product-zone-template.png


6. Backward Compatibility & Automatic Migration

The module features a seamless auto-migration subsystem:

Client Area

How the customer manages their DNS service: the home screen with the zone list and quota, adding a DNS zone, managing records of every supported type, and working with reverse-DNS (PTR) zones for IPv4 and IPv6.

Client Area

Home screen

PowerDNS module WHMCS

Order now | Download | Community

When a client navigates to Client Area → Services → My Services and selects their DNS Hosting service, the dashboard presents the primary zone management interface.

Client Area — DNS Zones Dashboard client-overview.png


1. Summary Cards

The top overview section provides real-time status metrics and configuration parameters:


2. DNS Zones Table

The main section lists all DNS zones provisioned under this service:

Column Description
Zone Name The root domain name of the zone (e.g., puq.info).
Status Current operational state: Active (green badge, active on server), Suspended (yellow badge, server zone purged due to billing suspension), or Not Allowed (red badge, conflict detected).
Actions Action controls available for each individual zone.

Available Zone Actions:


3. Real-Time Search & Add Zone

Client Area

Add DNS Zone

PowerDNS module WHMCS

Order now | Download | Community

Clients can add new forward or reverse DNS zones as long as their service has remaining quota.


1. How to Add a Zone

  1. On the service overview page, click the Add DNS Zone button.
  2. In the modal dialog:
    • Zone Name: Enter the domain name (e.g., puq.info or 113.0.203.in-addr.arpa for reverse DNS).
    • Zone Admin Email: If the hosting provider enables SOA editing, clients can enter a custom administrative contact email. Otherwise, this field is hidden and provider defaults are used.
  3. Click Add DNS Zone.

Add DNS Zone Dialog client-add-dns-zone.png


2. Automated Zone Provisioning Workflow

When the client clicks Add DNS Zone:

  1. Quota Check: WHMCS verifies that the client has not exceeded their service's maximum zone limit.
  2. Regex Validation: The domain name is verified for syntax compliance and checked against the provider's Zone name filter blacklist.
  3. PowerDNS Creation: The module sends a POST /api/v1/servers/localhost/zones request to PowerDNS:
    • Zone is created as Master with SOA-EDIT-API = INCREASE.
    • The SOA record is built using provider defaults and the client's email (if provided).
    • NS records are automatically inserted for all configured name servers.
    • Any boilerplate records defined in the provider's Zone template are generated with the {zone} placeholder substituted.
  4. Local Database Synchronization: WHMCS stores the zone record in puqPowerDNS_zones with status active.
  5. The modal closes and the dashboard updates automatically with a success toast notification.

3. Validation and Error Handling

Client Area

Managing DNS Records

PowerDNS module WHMCS

Order now | Download | Community

Click the Records button next to any active zone to access the DNS Records management console.


1. Zone Details & Toolbar

The zone view displays zone metadata, Start of Authority (SOA) details, and quick action buttons:

Client Zone Details & Toolbar client-zone-details.png


2. Resource Records Table & Quick Filters

Below the zone header, the console presents the resource records in a responsive table.

Interactive Quick-Filter Pills:

Above the table, interactive badge pills allow instant filtering by record type (e.g. All, A, AAAA, CNAME, MX, TXT, etc.).

Client Records Table — All Types client-records-table.png

Filtered Records View Examples:

Client Records Filter — A Records client-records-filter-a.png

Client Records Filter — AAAA Records client-records-filter-aaaa.png


3. Supported Record Types

The module supports 38 DNS record types. The modal dynamically adapts input fields and validation according to the selected type:

Type Description & Specific Fields
A Host IPv4 address (e.g. 192.0.2.1).
AAAA Host IPv6 address (e.g. 2001:db8::1).
AFSDB AFS Data Base location record (Subtype and Target hostname).
ALIAS Auto-resolved apex or subdomain alias (CNAME-flattening) to target hostname.
CAA Certification Authority Authorization (Flags 0–255, Tag issue/issuewild/iodef, Value).
CERT Certificate record (Certificate Type, Key Tag, Algorithm, Base64 Certificate).
CDNSKEY Child DNSKEY record for automated DS updates (Flags, Protocol, Algorithm, Public Key).
CDS Child DS record for automated parent zone DS updates (Key Tag, Algorithm, Digest Type, Digest).
CNAME Canonical name alias pointing to target hostname.
DNSKEY DNSSEC public key (Flags, Protocol 3, Algorithm, Public Key).
DNAME Delegation name redirecting an entire subtree of the domain hierarchy.
DS Delegation Signer record (Key Tag, Algorithm, Digest Type, Digest).
HINFO Host Information record (Hardware and OS / Software strings).
HTTPS HTTPS service binding and parameter endpoints (Priority, Target Name, Params key=value).
KEY Security public key record (Flags, Protocol, Algorithm, Public Key).
LOC Geographic location coordinates (RFC 1876 location string).
LUA PowerDNS dynamic LUA record (Target Type and LUA Script).
MX Mail exchange server (Priority integer and Target mail hostname).
NAPTR Naming Authority Pointer (Order, Preference, Flags, Service, Regexp, Replacement).
NS Authoritative Name Server target hostname (Provider NS records are protected from deletion).
NSEC DNSSEC Next Secure record (Next Domain Name and Record Types bitmap).
NSEC3 DNSSEC Next Secure v3 record (Hash Algorithm, Flags, Iterations, Salt, Next Hashed Owner Name, Types).
NSEC3PARAM DNSSEC NSEC3 Parameters record (Hash Algorithm, Flags, Iterations, Salt).
OPENPGPKEY OpenPGP public key record (Base64-encoded public key data).
PTR Pointer record for reverse DNS mapping.
RP Responsible Person mailbox and TXT domain pointer.
RRSIG DNSSEC resource record signature (Type Covered, Algorithm, Labels, Original TTL, Expiration, Inception, Key Tag, Signer Name, Signature).
SMIMEA S/MIME certificate association record (Usage, Selector, Matching Type, Certificate Association Data).
SOA Start of Authority (Managed via provider defaults or Edit SOA modal).
SPF Sender Policy Framework record.
SRV Service record (Priority, Weight, Port, Target hostname).
SSHFP SSH public host key fingerprint (Algorithm, Fingerprint Type, Hexadecimal Fingerprint).
SVCB General Service Binding record (Priority, Target Name, Params key=value).
TKEY Transaction Key record (RFC 3597 generic RDATA / hex payload).
TLSA Transport Layer Security Authentication (Usage, Selector, Matching Type, Certificate Association Data).
TSIG Transaction Signature record.
TXT Text record (String content; automatically quoted and split into 255-byte chunks).
URI Uniform Resource Identifier mapping (Priority, Weight, Target URI).

4. Add DNS Record

  1. Click the Add Record button.
  2. Select the Type from the dropdown menu.
    • If the hosting provider has configured Allowed record types, only those specific record types appear in the dropdown.
    • If no restriction is configured, all 38 record types are available.
  3. Enter the record Name (use @ for root domain apex, or enter subdomains like www, api, mail).
  4. Select the TTL (from 60 seconds up to 1 day).
  5. Enter the type-specific data values.
  6. Click Add Record. A loading spinner indicates active processing. Upon success, the table updates immediately.

Full Record Types Dropdown:

Add Record Modal — All 24 Types client-add-record-all-types.png

Restricted Allowed Record Types Dropdown:

When the administrator restricts allowed record types to e.g. A, AAAA, CNAME, MX, TXT: Add Record Modal — Filtered Types client-add-record-filtered-types.png

ALIAS Record Addition:

Add Record Modal — ALIAS client-add-record-alias.png


5. Edit and Delete Records

Edit Record:

Click the Pencil icon on any record row. The edit modal appears pre-populated with current values:

Client Edit Record Modal client-edit-record.png

Delete Record:

Click the Trash icon on any record row. A confirmation dialog prevents accidental deletion. Once confirmed, the record is removed from the PowerDNS server and table immediately.

ℹ️ Notice: Provider root NS records (at the zone apex) are protected with a lock icon and cannot be edited or deleted by clients. Subdomain NS records (e.g. sub.example.com) can be added, modified, and deleted freely.

Client Area

PTR IPv4 and IPv6

PowerDNS module WHMCS

Order now | Download | Community

Pointer (PTR) resource records provide Reverse DNS resolution — translating an IP address back into a canonical fully qualified domain name (FQDN). PTR records are critical for email deliverability (SPF/DKIM/rDNS checks) and network diagnostic logging.

1. Understanding Reverse DNS Zones

Reverse DNS lookups query specialized reverse zone domains determined by the network subnet:


2. Setting Up a Reverse Zone

  1. Ensure your upstream transit provider or IP registrar (RIPE, ARIN, APNIC) has delegated the corresponding reverse DNS subnet to your PowerDNS name servers.
  2. In the WHMCS client area, click Add DNS Zone.
  3. In Zone Name, enter the reverse zone domain (e.g., 113.0.203.in-addr.arpa).
  4. Click Add DNS Zone. The zone is created on the server as an authoritative master zone.

3. Adding PTR Records

  1. Open the reverse zone by clicking Records.
  2. Click Add Record and select Type: PTR.
  3. Fill in the parameters:
    • Name: The host identifier within the reverse zone:
      • For IPv4 host 203.0.113.10 inside zone 113.0.203.in-addr.arpa, enter 10.
      • For IPv6 host 2001:db8::1 inside zone 8.b.d.0.1.0.0.2.ip6.arpa, enter the reversed host nibble sequence.
    • TTL: Choose a cache lifetime (e.g., 3600).
    • Domain Name: The fully-qualified target domain name (e.g., mail.example.com).
  4. Click Add Record. The module automatically appends trailing dots as needed.

4. Verification

Test your reverse DNS propagation using dig or host:

# Test IPv4 PTR Record
dig -x 203.0.113.10 +short

# Test IPv6 PTR Record
dig -x 2001:db8::1 +short

The output should return your target FQDN.

Admin Area

What staff see and can do from the WHMCS admin side: the per-service zone list on the product page, with reload and delete actions, plus the license alert and zone-conflict handling.

Admin Area

Service Management (Admin)

PowerDNS module WHMCS

Order now | Download | Community

Administrators can manage DNS services directly from WHMCS Admin → Clients → [Select Client] → Products/Services (or via Clients → Services).

The module embeds an interactive Zones management section within the service details page:

Admin Service Zones Management admin-service-zones.png


1. Zones Management Table

The administrative panel displays all zones assigned to this service instance:

Column Description
Zone / Domain The fully qualified zone name.
Serial The SOA serial number of the zone as reported by PowerDNS.
Records Quick counter badge showing the total number of records in the zone (clickable to open the Records inspector modal).
Status active (live on server), suspended (kept in WHMCS, purged from server), or not allowed (conflict detected).
Actions Direct administrative controls for individual zones.

Top Toolbar & Zone Actions:


2. Administrative Modal Controls

Add DNS Zone (Admin):

Administrators can provision a new zone on behalf of the customer, bypassing quota or blacklist limits when necessary:

Admin Service Add Zone admin-service-add-zone.png

Manage DNS Records (Admin):

Inspect all active resource records, TTLs, and content strings in real time:

Admin Service Records Modal admin-service-records-modal.png

Zone Synchronization:

The Zone Synchronization modal allows administrators to scan the connected PowerDNS authoritative server and import pre-existing or orphaned zones directly into the client's service:

Admin Service Synchronization Modal admin-service-sync-modal.png


3. WHMCS Module Lifecycle Commands

The module integrates seamlessly with the standard WHMCS service lifecycle buttons:

Admin Area

License Alerts & Zone Conflicts

PowerDNS module WHMCS

Order now | Download | Community

1. Automated License Verification & Admin Alerts

The module validates licensing for each configured product against license.puqcloud.com.

Note: When a product's license is invalid or missing, automated module lifecycle commands (Create, Suspend, Unsuspend, Terminate) are halted, and a license validation warning is returned to prevent provisioning errors.


2. DNS Zone Conflicts Handling

A DNS zone must be strictly unique across an authoritative PowerDNS server. If a client attempts to create a zone that already exists on the server or is assigned to another WHMCS service:

  1. Client Experience: The client does not encounter an unhandled PHP or API exception. Instead, a clean, user-friendly notification informs them that the zone cannot be added.
  2. Database Logging: The attempted zone is logged in puqPowerDNS_zones with status not allowed.
  3. Automated Staff Task: The module automatically registers a high-priority To-Do item in WHMCS Admin → Utilities → To-Do List titled DNS zone conflict. The task includes:
    • Client ID and Service ID
    • Conflicting Zone Name
    • Reason for conflict (already exists on PowerDNS server or across another service)
  4. Staff can review the conflict, coordinate with the domain owner or remove stale orphan zones, and resolve the task.

3. Module Logging & Diagnostics

All outbound API calls to PowerDNS and licensing endpoints are recorded in WHMCS Admin → Utilities → Logs → Module Log under the identifier puqPowerDNS: