How to Configure DNS Nameservers with cPanel | cPanel Blog

How to Configure DNS Nameservers with cPanel | cPanel Blog

You might also like

The domain name system (DNS) is fiendishly complicated, and managing the nameservers that power it can be perplexing. Server administrators know how frustrating it is to change DNS configurations and patiently wait for them to propagate, only to find out something went wrong and the site is still unreachable.

You’ll be happy to hear that & WHM makes it super easy to manage and even a private nameserver.  In this article, we’re going to explore some essential DNS concepts and then show you how to configure a custom server with cPanel.

Before we wade into the deep end, let’s make sure we’re on the same page with a couple of terms:

  • Domain names are the web address you type into your browser. Businesses use domain names to promote their sites. We all know what they look like, a series of letters and numbers separated by periods ending with what’s called a top-level domain. For example, example.com.
  • IP addresses are the unique number the internet uses to route data to its destination. IP stands for Internet Protocol, and there are two common types of IP addresses: IPv4 and IPv6, but we’ll stick with IPv4 for simplicity. They look like this: 198.51.100.85

A has a name, which is for humans, and an IP address, which is for the machines that route data around the internet.

What is a Nameserver?

Nameservers are the internet’s contacts app. When you want to call someone, you search for a name, and the app gives you their number. To put it another way, a contacts app maps names to phone numbers.

A DNS server does the same for the internet, except it maps domain names to IP addresses. The internet’s routers and switches don’t understand domain names; they work with IPs. When you type a web address or click on a link, your browser knows the site’s name, but it has to execute a nameserver lookup to find out the matching IP address.

Each nameserver is a tiny part of a vast network. The domain name system is a hierarchical arrangement of servers that fall into two broad categories: recursive and authoritative. The one that knows the mapping between a site’s domain name and IP address is its authoritative DNS server; it’s the definitive source of truth about that domain. 

There are hundreds of thousands of authoritative nameservers on the internet. How does a browser know which one to ask? That’s the role of recursive nameservers. A browser asks a recursive server, often hosted by an ISP, to find the right IP address, and it asks the rest of the domain name system.

Recursive servers are an essential component of the domain name system, but we’re primarily interested in the authoritative variety because web hosts often manage the authoritative nameserver for their client’s domains.

What Are DNS Records?

DNS records indicate how domains correspond to IPs or other domains. They are stored in text documents called zone files, and they are the source of the information nameservers use to respond to lookup requests. A single record looks like this:

example.com.   IN   A    198.51.100.85

There are numerous types of records. In the example, we used an “A record,” which maps a domain to an IP address. Other types include:

  • CNAME records, which map one domain name to another. You might use a CNAME to point blog.example.com at example.com instead of having two “A records” for the same IP.
  • MX records are Mail Exchanger records. They say where incoming mail should be sent.
  • NS records indicate which DNS server is authoritative for a domain: ns1.mynameserver.com, for example.

Zone files can contain dozens of record types and other directives, but you will usually only need to edit these four, which can be done in the cPanel interface.

How Do I Find My DNS Records in cPanel?

cPanel creates and manages records in response to changes you make in the interface, but you can also edit zone files in the Zone Editor, which you will find in the Domains section of the cPanel Home page.

In the Zone Editor, it is easy to add, remove, and edit records for domains hosted on the server. Find the zone you would like to change, and click on Manage.

How Do I Change Nameservers in cPanel?

cPanel integrates the PowerDNS nameserver, a high-performance server with low memory requirements. PowerDNS is the default, but you can also select BIND if you need recursive DNS or to edit zone files manually.

There are also options to select MyDNS and NSD, but both are deprecated and will be removed from cPanel in the future.

Only server administrators can change the DNS server. You will find the setting under Nameserver Selection in the Server Configuration section of the WHM sidebar menu. You can also disable the nameserver on this page. We recommend that you stick with PowerDNS unless you need features only available in BIND.

How to Configure Custom Nameservers in cPanel

Your server’s domains must have an authoritative DNS server. You could use one provided by a third party, but you can also configure one locally on your cPanel server. A private nameserver lets providers give their customers a branded address such as ns1.mycompany.com.

Another benefit is that you control the domain. If you move to another server hosting platform, your domain comes too, and your clients don’t have to change their configuration.

cPanel & WHM makes it straightforward to configure a private domain server. The first step is to ensure the nameserver is active in the Nameserver Selection interface mentioned above.

Next, navigate to Basic WebHost Manager® Setup in WHM’s Server Configuration menu.

At the bottom of the page, enter two domain names of your choice. Typically, these are named ns1.mydomain.com and ns2.mydomain.com, where mydomain.com is a domain associated with your server.

Click “Configure Address Records” next to each entry and verify that the IP address is the same as your cPanel server. This will add the necessary records to the zone file.

Finally, tell your registrar about the DNS server’s domain names. The process differs depending on the registrar, so you should consult their DNS server documentation or How to Set Up Nameservers in a cPanel & WHM Environment, which includes instructions for various registrars and details on how to configure cPanel to use DNS servers hosted on different IPs.

After this last step, it may take some time until you can use your new server. The domain name system is massive, and records take a while to propagate around the world, but, all being well, you now have a private nameserver that clients can use for their domains.

The domain name system can be hard to get your head around, but, in most common web hosting and server administration scenarios, you only need to know a handful of concepts. cPanel & WHM takes care of the heavy lifting so that it’s straightforward to manage records and configure a private nameserver that reflects your business and its brand.

As always, if you have any feedback or comments, please let us know. We are here to help in the best ways we can. You’ll find us on Discord, the cPanel forums, and Reddit.

Random Articles

Web Design