# 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.

# Service Management (Admin)

### PowerDNS module **[WHMCS](https://puqcloud.com/link.php?id=77)**
##### [Order now](https://puqcloud.com/whmcs-module-powerdns.php) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-PowerDNS/) | [Community](https://community.puqcloud.com/)

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](https://doc.puq.info/uploads/images/gallery/2026-11/embedded-image-onna7twk.png)
*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:
- **Add Zone**: Create a new zone directly on the service (with an option to pull existing server records if the zone already exists on PowerDNS).
- **Pull from Server**: Discover all zones hosted on the PowerDNS server and import an existing zone into this customer's service with all records preserved.
- **Refresh**: Reloads the administrative zones table via AJAX.
- **Records**: Opens the administrative **DNS Records** modal to inspect, filter by record type, search, or delete resource records directly without logging into the client area.
- **Sync**: Opens the **Zone Synchronization** modal, comparing the PowerDNS server zone with the WHMCS local database (identifying in-sync records, server-only records, local-only records, and conflicts) and allowing granular conflict resolution.
- **Push to Server (☁↑)**: Pushes the local WHMCS database records for the zone directly to the PowerDNS server.
- **Delete (🗑)**: Removes the zone from WHMCS, with a checkbox to also delete the zone from the PowerDNS server.

---

## 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](https://doc.puq.info/uploads/images/gallery/2026-11/embedded-image-y9jxvmxm.png)
*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](https://doc.puq.info/uploads/images/gallery/2026-11/embedded-image-a1tcbhqn.png)
*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](https://doc.puq.info/uploads/images/gallery/2026-11/embedded-image-882cxgto.png)
*admin-service-sync-modal.png*

---

## 3. WHMCS Module Lifecycle Commands

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

- **Create**: Executed upon order activation. If a domain name was supplied during checkout, it is automatically provisioned as the client's first DNS zone.
- **Suspend**: Triggered upon overdue invoice or manual administrative suspension. Purges all active zones of this service from the PowerDNS authoritative server while **preserving all records in the WHMCS database** (marked as `suspended`).
- **Unsuspend**: Re-provisions all suspended zones and their corresponding records back onto the PowerDNS server.
- **Terminate**: Executed upon service cancellation or termination. Permanently deletes all associated zones and records from both the PowerDNS server and WHMCS.


<!-- sync:2a169fb6a9cbdaa2 -->

# License Alerts & Zone Conflicts

### PowerDNS module **[WHMCS](https://puqcloud.com/link.php?id=77)**
##### [Order now](https://puqcloud.com/whmcs-module-powerdns.php) | [Download](https://download.puqcloud.com/WHMCS/servers/PUQ_WHMCS-PowerDNS/) | [Community](https://community.puqcloud.com/)

---

## 1. Automated License Verification & Admin Alerts

The module validates licensing for each configured product against `license.puqcloud.com`.
- Verification transactions occur online periodically and are securely cached in the local database (`puq_license`), ensuring that temporary connectivity interruptions to the license server never disrupt customer DNS operations.
- If a product is configured with an invalid or expired license key, an alert notification is prominently displayed on the **WHMCS Admin Dashboard**. The alert lists each affected product and provides a direct shortcut link to its configuration page.

> **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`:
- To keep logs clean and readable, routine offline database license checks are suppressed from the module log.
- Full HTTP request endpoints, request payloads, response bodies, and HTTP status codes are recorded for API interactions, providing complete diagnostic visibility.


<!-- sync:01dfaaca69214a48 -->

