How to Set Up Nameservers in a cPanel & WHM Environment

This article explains how nameservers work in a cPanel & WHM environment and provides a complete step-by-step guide to configuring nameserver software, setting default nameservers, assigning IP addresses, creating A/AAAA records, and adding A records for the server hostname. It is designed for administrators who want to properly configure DNS for their hosting infrastructure.

cPanel nameserversWHM DNS setupA records, PowerDNSBasic WebHost Manager Setup

~8 min read • Updated Feb 18, 2026

1. Overview


Nameservers map domain names to IP addresses. When a visitor attempts to access a website hosted on your server, their computer queries a nameserver to obtain the correct IP address. The nameserver responds with the IP address and directs the visitor to the appropriate website.


To ensure that visitors can reach your hosted domains, you must publish DNS records to nameservers. These nameservers communicate with other DNS servers across the internet to propagate your domain’s DNS information.


The propagation period refers to the time required for DNS changes to spread globally.


You can configure and manage nameservers using several WHM interfaces.


2. Default Nameservers


When you log in to WHM for the first time, the system may assign default cprapid.com nameservers. These are placeholders and are not compatible with many domain extensions, including .com.


To ensure proper DNS functionality, you must configure your own nameservers in WHM.




3. Configure Nameservers via WHM Interfaces


3.1 Select a Nameserver Software


Note: If you use your registrar’s DNS services, you may skip this step.

To select a nameserver software:

  1. Navigate to WHM » Home » Service Configuration » Nameserver Selection.
  2. Select the desired nameserver software.
  3. Click Save.

Note: WHM installs PowerDNS by default.




3.2 Configure Your Default Nameservers


To set your default nameservers:

  1. Navigate to WHM » Home » Server Configuration » Basic WebHost Manager Setup.
  2. Scroll to the bottom of the interface.
  3. Enter your desired nameserver names (e.g., ns1.example.com, ns2.example.com).
  4. Click Save Changes.

Recommended Naming Guidelines

  • Use the format: prefix.domain (e.g., ns1.example.com).
  • Each nameserver must have a unique name.
  • Use a domain that represents your company’s main website.



3.3 Add IP Addresses


To add IP addresses to your server:

  1. Navigate to WHM » Home » IP Functions » Add a New IP Address.
  2. Enter the IP address or range in the New IP or IP range to add field.
  3. Enter the subnet mask.
  4. Optionally, exclude specific IPs.
  5. Click Submit.



3.4 Create A or AAAA Records for Nameservers


To create A/AAAA records for your nameservers:

  1. Navigate to WHM » Home » Server Configuration » Basic WebHost Manager Setup.
  2. Next to each nameserver field, click Configure Address Records.
  3. The system will perform a DNS lookup.
  4. Optionally update the IP addresses:
  • Enter a new IPv4 address in the A record field.
  • Enter a new IPv6 address in the AAAA record field (optional).

Click Configure Address Records to apply changes, then click Close.


Repeat for each nameserver.




3.5 Create A Records for Your Hostname


To create an A record for your server’s hostname:

  1. Navigate to WHM » Home » DNS Functions » Add an A Entry for Your Hostname.
  2. Enter your server’s IP address.
  3. Click Add Entry.



4. Conclusion


Properly configuring nameservers in a cPanel & WHM environment ensures that your domains resolve correctly and that visitors can reach your websites without interruption. By selecting nameserver software, setting default nameservers, assigning IP addresses, and creating the necessary DNS records, you establish a reliable DNS infrastructure for your hosting environment.


1. Set Up Nameservers with Your Registrar


After configuring your server’s nameservers in WHM, you must register them with your domain registrar. This step announces your nameservers to the global DNS system.


Important: This action is not performed inside WHM. If you do not register your nameservers with your registrar, they will not function.


Registrar-specific instructions are provided later in this article.




2. Manage Reseller Nameservers


After setting up your main nameservers, you may want to assign custom nameservers for your resellers. cPanel & WHM supports a white-label reseller experience, allowing each reseller to use their own branded nameservers.


Note: Resellers can have their own nameservers, but individual cPanel accounts cannot.


To configure reseller nameservers:

WHM » Home » Resellers » Edit Reseller Nameservers and Privileges



3. Select a Nameserver Software


Note: If you use your registrar’s DNS services, you may skip this step.

cPanel & WHM offers the following nameserver software:

  • PowerDNS — Default and recommended for most servers
  • BIND
  • Disabled

To select nameserver software:

WHM » Home » Service Configuration » Nameserver Selection



4. Name Your Nameservers


When naming your nameservers, follow these guidelines:

  • Use the format: prefix.domain (e.g., ns1.example.com).
  • Nameservers must not share the same name.
  • Use a domain that reflects your company’s main website.



5. Create A Records and Add IP Addresses


To ensure your nameservers function correctly, you must create A records for them and assign IP addresses.


Recommended: Enable both options:

  • Add “A Entries” for all Nameservers
  • Add “A Entries” for Hostname

If you do not manually enter IP addresses, WHM will automatically assign available IPs.




6. Registrar-Specific Instructions


Below are the steps for registering nameservers with various registrars.


6.1 123-reg.co.uk

  1. Select your domain.
  2. Modify Domain → Change Nameservers.
  3. Enter ns1 and ns2.
  4. Enter IP addresses.

6.2 DirectNIC

  1. Domain Manager → Change Nameserver Information.
  2. Create Nameserver.
  3. Enter ns1.example.com and its IP.

6.3 Dotster

  1. My Domains → Register Nameserver.
  2. Enter ns1.example.com and IP.

6.4 DynaDot

  1. Domain Names → Nameservers.
  2. Register a domain name server.
  3. Enter ns1.example.com and IP.

6.5 Enom

  1. Select Domain Names.
  2. Register DNS.
  3. Create nameserver entries.

6.6 GoDaddy

  1. All Domains → Manage DNS.
  2. Settings → Host Names → Add Hostname.
  3. Enter ns1 and IP.
  4. Custom Nameservers → ns1.example.com, ns2.example.com.

6.7 NameCheap

  1. Select domain.
  2. Nameserver Registration.
  3. Enter IPs.

6.8 Network Solutions

  1. Manage Host Servers.
  2. Enter ns1.example.com → IP.
  3. Save Changes.

6.9 OpenSRS

  1. Name Servers.
  2. Create or modify a name server.
  3. Enter ns1 and IP.

6.10 Register.com

  1. Advanced Technical Settings.
  2. Manage Registered Name Servers.
  3. Enter ns1 + IP.



7. Using PowerDNS in cPanel


7.1 Overview

PowerDNS is a high-performance DNS server with low memory usage. In cPanel, PowerDNS reads DNS data from BIND files and stores DNSSEC data in SQLite, making it compatible with cPanel’s DNS tools.


7.2 Install PowerDNS

WHM » Home » Service Configuration » Nameserver Selection

Select PowerDNS → Save.


7.3 Check PowerDNS Version

Use WHM API

1. Overview


The ALIAS DNS record allows a domain name to resolve to the IP addresses of another fully qualified domain name (FQDN). While this may seem useful for pointing a domain to an external service, cPanel & WHM strongly recommends avoiding this record type due to reliability and security concerns.


Warning: Using ALIAS records may cause unexpected behavior, including downtime, inconsistent DNS handling, and security vulnerabilities. This record is only available when PowerDNS is enabled and ALIAS access is manually activated.




2. About the ALIAS DNS Record


ALIAS records are commonly used to point a domain to external services such as SaaS platforms or load balancers. However, this record type is not RFC-compliant and behaves inconsistently across DNS providers.


2.1 Why ALIAS Records Are Not Recommended

  • If the external target changes its IP address, your domain may become unreachable.
  • Different DNS providers implement ALIAS differently, causing unpredictable behavior.
  • Existing A or AAAA records may conflict with ALIAS records.
  • ALIAS records can break DNSSEC validation.
  • Because ALIAS is not based on an RFC, support may be removed without warning.



3. Enable Access to the ALIAS DNS Record


To enable ALIAS record support, the system administrator must manually activate it on the server.


3.1 Create the Required Touch File

Run the following command as the root user:

touch /etc/pdns/danger-danger-danger-server-owners-understand-the-severe-risk-and-accept-responsibility-for-any-consequences-of-using-experimental-alias-records

3.2 Update the PowerDNS Configuration

Add the following entries to /etc/pdns/pdns.conf, replacing 192.0.2.3 with your resolver’s IP address:

expand-alias=yes
resolver=192.0.2.3

3.3 Restart PowerDNS

/scripts/restartsrv_pdns

After restarting, ALIAS records will be available in:

WHM » Home » DNS Functions » DNS Zone Manager



4. Enable ALIAS Access for cPanel Users


To allow cPanel users to create ALIAS records, the administrator must enable the Zone Editor (AAAA, CAA, SRV, TXT) feature in:

WHM » Home » Packages » Feature Manager



5. Check Whether ALIAS Records Are Enabled


You can verify ALIAS support using WHM API 1’s is_alias_available function.




6. Conclusion


The ALIAS DNS record may appear convenient, but it introduces significant risks, including downtime, DNS conflicts, and security issues. Because it is not RFC-compliant and behaves inconsistently across providers, cPanel strongly recommends avoiding it unless absolutely necessary. If you choose to enable it, proceed with caution and ensure you understand the potential consequences.


Written & researched by Dr. Shahin Siami