Domains and DNS
This page covers the Domains & DNS menu: nameserver nodes, DNS zones, the record editor, zone templates, BIND import and export, default nameservers, cPanel DNSOnly replicas, cluster sync, and domain ownership rules.
The panel's DNS uses PowerDNS. Zones are created automatically when an account or website is created, and website and email records are added automatically.
INFO
If the page shows DNS is not enabled, there is no nameserver node yet. Click Enable DNS in that notice, or open the Nameserver nodes tab. See Nameserver nodes.
The page has three tabs: Zones, Zone templates, and Nameserver nodes. The sidebar has a single Domains & DNS item; the other tabs are opened from that page or from global search.
Nameserver nodes
The Nameserver nodes tab is the main way to enable and manage DNS. Each node is a MoorCP server running PowerDNS with its own zone database, just as each cPanel DNSOnly node keeps its own zone files. A node can be a hosting server or a DNS-only VPS.
| Data | Stored in |
|---|---|
| All records of every zone | Every node (primary and replicas) |
| Zone ownership, templates, node list, nameservers | Panel database |
| BIND copy of every zone | Panel database, included in the panel backup |
Every action on this tab is for administrators only, because a node installs PowerDNS as root on the server. Other roles only see the status. When DNS is not enabled, other roles see "DNS is not enabled yet. An administrator can enable it here."
Enabling DNS
- Open Domains & DNS › Nameserver nodes.
- In the Enable DNS card, fill in the Default nameservers, e.g.
ns1.example.comandns2.example.com. At least 2, at most 6; use + Add nameserver to add a row. - Choose the Primary node. The list marks servers as DNS-only or hosting, and PowerDNS ready when the installer already installed PowerDNS.
- Click Enable DNS.
The agent installs PowerDNS on that server: the zone database on that server, the API only on 127.0.0.1, and port 53 opened in the firewall. Existing zones are copied to the node. The panel never calls the PowerDNS API directly; every request goes through the agent connection (mTLS).
Installation is refused when port 53 is already used by another service, or when /etc/pdns/pdns.conf exists and was not created by MoorCP.
Adding a DNS-only VPS
The Add a DNS-only VPS section explains how:
Create a registration token in Servers › Install command.
Run the installer in DNS mode on the new VPS (AlmaLinux/Rocky 9; 1 vCPU / 1 GB is enough):
bashcurl -fsSL https://get-shared.moorcp.com | sudo bash -s -- dns --panel https://panel.example.com:8443 --token TOKENOnce the server is registered, add it as a node.
A DNS-only VPS runs only the agent and PowerDNS, without the hosting stack. It is never used for accounts. A hosting server can also be a node: install the agent with the --dns option, or just pick the server in the node list. See Installer options.
Nodes card
The Nodes card shows the number of nodes and the number of zone copies the panel stores (zone copies stored in the panel). Table columns:
| Column | Contents |
|---|---|
| Server | Hostname, IP, and a DNS-only badge for DNS-only servers. |
| Role | Primary or Replica. |
| Status | The PowerDNS version when running, PowerDNS not running, or Agent unreachable. |
| Zones | Number of zones on that node. |
Changes go to the primary first, then to every replica. A replica that was down is brought up to date by the next sync, every 10 minutes, or right away with Run reconciliation on the Zones tab.
| Action | Result |
|---|---|
| Add node | Choose a server. The new node becomes a replica: every zone is copied from the primary in the background, then kept in sync. |
| Make primary | Replicas are synced first (when the old primary is reachable), then this node becomes the primary. |
| Remove | PowerDNS on that server is stopped; its zone database is kept. The primary can only be removed after another node is made primary, unless it is the only node. |
WARNING
Before removing a node, update the A record and glue of the nameserver that points to it.
DANGER
Removing the last node stops DNS for every zone. Zone copies stay in the panel and are restored when a node is added again.
Zone copies
On every sync round, the panel stores a BIND copy of each zone that changed. An account zone missing from the primary is rebuilt from this copy, including records the client created. If there is no copy yet, the zone is built from its template. The copy is deleted when the zone is deleted through the panel.
At the registrar
The At the registrar card lists each default nameserver and the node it should point to. Create an A record for each of those hostnames, then register them as child nameservers (glue) at the registrar of the parent domain.
Configuration through env
When MOORCP_DNS_DRIVER is set in /etc/moorcp-shared/env, this tab shows DNS is configured on the control plane and nodes are not managed here. Remove that line and restart the panel to manage nodes from this tab. See Cluster through env.
cPanel DNSOnly replicas
An existing cPanel DNSOnly server can also answer for MoorCP zones as a replica. The primary stays a MoorCP node. The cPanel DNSOnly replicas card is on the Nameserver nodes tab.
Adding a DNSOnly replica
In WHM on that DNSOnly server, create an API token in Development › Manage API Tokens.
In the cPanel DNSOnly replicas card, click Add cPanel DNSOnly.
Fill in the form:
Field Description Name Replica name, e.g. dns1.WHM URL E.g. https://dns1.example.com:2087. Port 2087 when omitted.WHM user Default root.API token Stored encrypted and never shown again. Certificate SHA-256 fingerprint (optional) Only when WHM uses a self-signed certificate. Click Test and add. The panel tests the connection and the token before saving, then copies the MoorCP zones to that server.
WHM with a certificate from a public CA is trusted directly. A self-signed certificate is rejected and the panel shows the SHA-256 fingerprint it sees. Compare it first on that DNSOnly server:
openssl x509 -noout -fingerprint -sha256 -in /var/cpanel/ssl/cpanel/cpanel.pemIf it matches, enter the fingerprint in the form. A replica with a pinned fingerprint is marked pinned.
Sharing with cPanel servers
- MoorCP only writes its own zones. Other zones on DNSOnly, coming from your cPanel servers, are never deleted.
- The MoorCP zones column only counts MoorCP zones, in the form N of M on server.
- Remove makes MoorCP stop writing to that server. Check Also delete MoorCP zones from this server to delete the MoorCP zones there, without touching the cPanel zones. Click Remove replica.
WARNING
A domain that still exists on a cPanel server is also sent by that server to DNSOnly, so both can overwrite each other's zone content. After moving an account to MoorCP, delete it on cPanel. If cPanel also deletes the zone from DNSOnly, the MoorCP sync recreates it within 10 minutes at most. Run reconciliation on the Zones tab restores it right away.
Migrating from cPanel: zones held until cutover
The initial import of a cPanel migration creates the account's zones in MoorCP already pointing to the new server's IP, roughly a week before the final sync and cutover. So the domain does not move too early, every imported zone is held from the DNSOnly replicas:
- While held, MoorCP does not create, change, or delete that zone on DNSOnly. DNSOnly keeps serving the version from the source cPanel server. MoorCP nodes still receive the zone as usual.
- Held zones are not counted in the replica status and are not deleted by Also delete MoorCP zones from this server.
- Cutover releases the hold. After the A record in the source zone is pointed over, cutover copies the MoorCP zone to every DNSOnly right away. Clients do not need to change nameservers.
The held zones are listed on the replica card as N migrated zone(s) held until cutover. Release, then Release and copy, copies the MoorCP zone to DNSOnly right away, replacing the version from the cPanel server. Use it only when the migration was abandoned. Administrators only; recorded in the audit log as dns.replica.release.
After cutover:
- Delete the account on cPanel with the option to keep the DNS zone. Without that option, cPanel deletes the zone from DNSOnly, and the domain does not answer until the MoorCP sync recreates it.
- Do not run Synchronize DNS Records from the source cPanel server for domains that were moved. Its old version would overwrite the MoorCP zone until the next sync round.
- Once every account on a cPanel server has moved, remove that server from its DNS cluster.
See also Importing from cPanel.
Zone list
The Zones tab shows:
- Summary cards: number of zones (and zones not recorded as owned by an account), Nameservers status (how many nodes are up), and Reconciliation (in sync, or how many zones differ).
- Domain search and filters for server, account, and reconciliation status.
- A table with the Domain (Zone), Account, Records, Template, per-node status, and Actions columns.
- The Nameserver information card below the table.
Each zone's action menu has Open editor, Export zone file, and Open account. Select several zones and click Export zone files to export them at once.
Creating a zone
- Click Create zone.
- Choose the Account.
- Enter the Domain. It must be the account's primary domain or one of its website domains.
- Choose a Template, or leave Default template.
- Save.
You usually do not need to create zones manually: they are created automatically when a new account or website is created.
Zone editor
Click Open editor on a zone. The editor page shows:
- Zone summary: zone name, Authoritative nameservers, number of records, creation date.
- DNS propagation: a reminder that changes are written to every nameserver right away, but resolvers that cached the old value keep it until the TTL expires (up to 24 hours).
- The record table with search and a type filter.
- The Export zone, Import, Apply template, Reset zone, and Add record buttons.
Adding or editing a record
Click Add record, or Edit on an existing record.
Fill in the fields:
Field Description Name Relative to the zone. @for the apex,*.appfor a wildcard.Type A, AAAA, CNAME, MX, TXT, SRV, CAA, or NS. The type cannot be changed after the record is created. TTL 60 to 604800 seconds. Values One value per line. TXT values are quoted automatically. Click Save record. Values are validated before saving.
To delete, choose Delete record. Every value of that RRset is removed from every nameserver.
INFO
The SOA and apex NS records are managed by the panel (marked managed by panel) and cannot be changed in the editor. Change them through the default nameservers.
BIND import and export
- Export zone downloads the zone file in BIND format.
- Import accepts the contents of a BIND zone file (at most 1 MiB).
Import steps:
- Click Import.
- Paste the file contents into BIND zone file.
- Choose the Mode:
- Merge: replace only record sets in the source: only the RRsets in the file are replaced; other records stay.
- Replace: remove everything else: records not in the file are deleted.
- Click Preview changes. The panel shows the records that will be added, changed, deleted, and left unchanged.
- Click Apply. For Replace mode, type the zone name to confirm.
SOA and apex NS records in the file are skipped, because the panel manages them.
Resetting a zone
Reset zone puts the zone back to its template, like Reset Zone in cPanel. It uses the template the zone was created with (or last applied), otherwise the default template.
- Click Reset zone. The changes are calculated right away: the template name, records added, changed, and removed, and the records that are kept.
- Review the list, type the zone name, then click Reset zone.
If the zone already matches its template, the dialog says so and there is nothing to reset. Clients have the same Reset zone button in their own DNS page.
A record kept for a website is still replaced when it conflicts with a template record of the same name, e.g. a www CNAME when the template has a www A record. The template record wins, so the reset does not fail.
Applying a template
To apply another template, or to only add the template's records without removing others, use Apply template:
- Click Apply template.
- Choose a template. Zone's template, else default uses the zone's own template, or the default template.
- Choose the Mode:
- Merge: replace only record sets in the source: RRsets in the template are replaced; other RRsets stay.
- Reset to template: remove everything else: every record not in the template is deleted.
- Click Preview changes, review, then Apply. Reset mode asks you to type the zone name.
In Replace and Reset to template modes, these records are kept (shown as Kept (managed by the panel)):
- SOA and apex NS;
- DKIM TXT (
*._domainkey) and_acme-challenge; - A, AAAA, and CNAME for the account's website domains, including
www..
DANGER
Replace and Reset to template delete client-created records that are not in the source, such as MX records or TXT verification records for other services. Always check the preview before applying.
Zone templates
The Zone templates tab holds record templates for new zones. New zones, including those created automatically with a website, use the Default template.
Built-in templates
| ID | Contents |
|---|---|
standar | Apex, www, mail, and webmail A/AAAA (webmail lets clients open webmail at webmail.<domain>); MX; SPF mx a ~all; DMARC quarantine; autoconfig/autodiscover; CAA. The initial default. |
web | Apex and www A/AAAA; SPF -all and DMARC reject, for domains without email. |
google-workspace | Web on this server; Google MX, Google SPF, extra CAA for Google. |
microsoft-365 | Web on this server; Microsoft 365 MX, SPF, and autodiscover. |
Placeholders
Template record values can use placeholders that are filled in when the zone is created:
| Placeholder | Filled with |
|---|---|
{zone} | The zone's domain, e.g. myshop.com. |
{zone_dashed} | The zone with dots replaced by dashes, e.g. myshop-com. |
{ipv4} | The main IP of the account's server. |
{ipv6} | The server's IPv6. The record is skipped when the server has no IPv6. |
{mailhost} | The mail host, default mail.{zone}. |
{hostname} | The hostname of the account's server. |
{caa_issuer} | The CA allowed in CAA (MOORCP_DNS_CAA_ISSUER). |
Records whose placeholder is empty on the target server are skipped and reported as Skipped.
Managing templates
| Action | Result |
|---|---|
| Create template | A new template. The ID uses lowercase letters, digits, and dashes. |
| Edit | Changes the template records, with a preview for a sample zone. |
| Duplicate | A copy of the template to edit. |
| Make default | The template for new zones. Only one template is the default. |
| Restore built-in | Restores a changed built-in template (Customized) to its original contents. |
| Delete template | Deletes an admin-created template. |
| Apply template (review first) | Applies the template to an existing zone, with a review of the changes. |
Templates are validated on save. Unknown placeholders, malformed records, CNAMEs mixed with other types on the same name, and SOA/apex NS records are rejected.
INFO
Template changes only apply to zones created afterward. Existing zones do not change until you use Apply template or Reset zone on them.
Default nameservers
The default nameservers become the NS records of every panel zone, and the first nameserver becomes the SOA primary host (MNAME).
To change them (administrators only):
- On the Zones tab, open the Nameserver information card. The same button is also on the Nodes card of the Nameserver nodes tab.
- Click Change nameservers.
- Enter 2 to 6 hostnames, e.g.
ns1.example.comandns2.example.com. Use Add nameserver to add a row. Do not enter IP addresses. - Click Save.
Result:
- The apex NS and SOA MNAME of every zone are replaced right away. Zones that already match are not touched. Zones that fail are reported one by one.
- The panel keeps every zone in line: at startup and every 10 minutes (
MOORCP_DNS_SYNC_SECONDS, default 600), zones changed outside the panel are corrected automatically. - The setting from the panel overrides
MOORCP_DNS_NAMESERVERSin the env file. Until it has been set from the panel, the env value is used. - Hostnames without an A/AAAA record are reported as a warning, not rejected.
WARNING
The panel only changes zone contents, not the delegation at the registrar. You still need to:
- Create an A record (and AAAA if any) for each nameserver hostname, pointing to the PowerDNS node. The At the registrar card on the Nameserver nodes tab shows the pairs.
- Register those hostnames as hosts (glue records) at the registrar of the parent domain, e.g.
example.comforns1.example.com. - Point each client domain to the same nameservers at its registrar.
Cluster through env
Before the Nameserver nodes tab existed, DNS was configured with env variables on the control plane (MOORCP_DNS_DRIVER=lokal with the PowerDNS API). This is still supported. While the env setting is active, nodes from the Nameserver nodes tab are not used.
With env, there are two ways to run more than one nameserver:
| Method | Description |
|---|---|
| Database replication outside the panel | The panel knows only one PowerDNS API. ns2 reads the replicated database. The nameserver card calls this mode "Single node". |
| API replication by the panel | Each PowerDNS node has its own database, and the panel writes to all of them. Replica nodes are set with MOORCP_PDNS_REPLICAS. |
How to set MOORCP_DNS_DRIVER and MOORCP_PDNS_REPLICAS is described in Environment variables.
Sync and reconciliation
These rules apply both to nodes from the Nameserver nodes tab and to API replication through env:
- The panel writes to the primary first. A failure on the primary fails the operation. A failed write to a replica is recorded as pending and does not fail the operation.
- The Nameserver information card on the Zones tab shows each node (Primary or Replica), its status (or unreachable), and the number of missing, differing, or extra zones.
- Reconciliation runs automatically every 10 minutes (
MOORCP_DNS_SYNC_SECONDS, default 600). Run reconciliation runs it right away.
Reconciliation:
- creates missing zones on replicas and makes their contents match;
- deletes zones on replicas that do not exist on the primary (except non-MoorCP zones on cPanel DNSOnly replicas);
- recreates account zones missing from the primary, from the zone copy or from their template.
Zones that exist on a nameserver but are not recorded as owned by any account (e.g. a hostname zone managed by the administrator) are only reported, never deleted.
Domain ownership
A domain name and all its subdomains can be used by only one account across the whole panel, on whatever server that account lives.
The reason: PowerDNS always answers from the most specific zone. If account B could create the zone shop.example.com while example.com belongs to account A, every query for shop.example.com would be answered from B's zone. Account B would take over a subdomain of account A.
What counts as owned by an account: the primary domain of an account that is not terminated, every website domain (primary, addon, subdomain, alias), and every DNS zone of the account.
Example when account A owns example.com:
| Request by account B | Result |
|---|---|
New account with primary domain example.com | Rejected |
New account with primary domain shop.example.com | Rejected |
Website or alias shop.example.com | Rejected |
DNS zone shop.example.com | Rejected |
example.com.au or other.com | Allowed |
- Account A itself can still add
shop.example.comas a subdomain. - The error message does not name the owning account.
- The rule applies on every path: admin panel, client panel, billing, and cPanel import.
Exception. The parent domain of a subdomain owned by another account is still allowed. If account A owns only blog.example.com, the owner of example.com can still sign up as account B, so a domain owner is never locked out. If blog.example.com should belong to B, delete the website or zone in account A, then recreate it in account B.
INFO
This rule only checks new creations. Conflicts left over from older versions are not changed automatically.
Records changed from the client panel
Besides the zone editor, two client features write to zones hosted on the panel:
- Dynamic DNS (client DNS Zone › Dynamic DNS): a hostname in the account's zone whose A/AAAA records (TTL 60) are updated by a router or script over the dyndns2 protocol at
/nic/updateon the client panel origin. At most 20 per account; the zone apex and website domains are refused. See DNS. - Repair DNS records in Email deliverability (client) or Check DNS in the account's Email section (admin): sets DKIM, merges SPF without removing the user's own entries, and adds DMARC or MX only when missing. Recorded in the audit log as
mail.auth_repair.
