fbpx

How to Configure DNS Nameservers with cPanel

The domain name system (DNS) is devilishly complex, and managing the nameservers that power it can be a nightmare. Server administrators understand how aggravating it is to change DNS settings and patiently wait for them to propagate, only to discover that something went wrong and the site is still unavailable.

You’ll be relieved to learn that cPanel and WHM make managing domains and even a private nameserver a breeze. In this article, we’ll go over some fundamental DNS concepts before showing you how to set up a custom server with cPanel.

Before we dive in, let’s make sure we’re all on the same page with a couple of terms:

  • Domain names are the web addresses that you type into your browser. Domain names are used by businesses to promote their websites. We’ve all seen them: a string of letters and numbers separated by periods that end with a top-level domain. Consider the domain example.com.
  • IP addresses are unique numbers used by the internet to route data to its destination. IP stands for Internet Protocol, and there are two types of IP addresses: IPv4 and IPv6, but for the sake of simplicity, we’ll stick with IPv4. They appear as follows: 198.51.100.85

A website has a name for humans and an IP address for the machines that route data across the internet.

What is a Nameserver?

Nameservers are the internet’s address book. When you want to call someone, you search for their name and the app returns their phone number. In other words, a contacts app maps names to phone numbers.

A DNS server performs the same function for the internet, but it maps domain names to IP addresses. Routers and switches on the internet do not understand domain names; instead, they use IP addresses. When you type a web address or click a link, your browser recognizes the site’s name but must perform a nameserver lookup to determine the matching IP address.

Each nameserver is a speck in the vast network. The domain name system is a hierarchical arrangement of servers classified as recursive or authoritative. The authoritative DNS server is the one who knows the mapping between a site’s domain name and IP address; it is the only source of truth for that domain.

On the internet, there are hundreds of thousands of authoritative nameservers. How does a browser determine which one to query? That is the function of recursive nameservers. A browser queries a recursive server, which is frequently hosted by an ISP, and then queries the rest of the domain name system.

Recursive servers are an important part of the domain name system, but we’re most interested in the authoritative variety because web hosts frequently manage the authoritative nameserver for their clients’ domains.

What Are DNS Records?

DNS records specify how domains are related to IP addresses or other domains. They are stored in text documents known as zone files and are the source of information used by nameservers to respond to lookup requests. A single record appears to be as follows:

example.com. IN A 198.51.100.85

There are various kinds of records. We used an “A record” in the example to map a domain to an IP address. Other types are as follows:

  • CNAME records are records that map one domain name to another. Instead of having two “A records” for the same IP, you could use a CNAME to point blog.example.com to example.com.
  • MX records are mail Exchanger records. They specify where incoming mail should be delivered.
  • NS records, for example, indicate which DNS server is authoritative for a domain: ns1.mynameserver.com.

Zone files can contain dozens of record types and other directives, but you’ll usually only need to edit four of them, which you can do in the cPanel interface.

How Do I Find My DNS Records in cPanel?

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

It is simple to add, remove, and edit records for domains hosted on the server using the Zone Editor. Find the zone you want to change and click Manage.

How Do I Change Nameservers in cPanel?

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

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

Only server administrators have the ability to change the DNS server. The setting is located in the Server Configuration section of the WHM sidebar menu under Nameserver Selection. On this page, you can also disable the nameserver. Unless you require features that are only available in BIND, we recommend that you stick with PowerDNS.

How to Configure Custom Nameservers in cPanel

Each domain on your server must have an authoritative DNS server. You can use a third-party one, but you can also configure one locally on your cPanel server. A private nameserver enables hosting providers to provide branded addresses to their customers, such as ns1.mycompany.com.

Another advantage is that you own the domain. If you switch server hosting platforms, your domain will follow you, and your clients will not need to change their settings.

cPanel and WHM make it simple to set up a private domain server. The first step is to ensure that the nameserver is active in the aforementioned Nameserver Selection interface.

Then, in WHM’s Server Configuration menu, select Basic WebHost ManagerĀ® Setup.

Enter two domain names of your choice at the bottom of the page. These are typically named ns1.mydomain.com and ns2.mydomain.com, where mydomain.com is the domain associated with your server.

Check that the IP address is the same as your cPanel server by clicking “Configure Address Records” next to each entry. This will populate the zone file with the necessary records.

Finally, inform your registrar about the domain names of the DNS server. The procedure varies depending on the registrar, so consult their DNS server documentation, which includes instructions for various registrars as well as details on how to configure cPanel to use DNS servers hosted on different IP addresses.

It may take some time after this final step before you can use your new server. The domain name system is massive, and records take time to propagate around the world, but you now have a private nameserver that clients can use for their domains if all goes well.

The domain name system can be difficult to grasp, but in most common web hosting and server administration scenarios, you only need to understand a few concepts. cPanel and WHM handle the heavy lifting, making it simple to manage records and configure a private nameserver that reflects your company and its brand.

Michael
WRITTEN BY

Michael

My name is Michael. I'm a passionate Web Designer & Blogger.

Leave a Reply