Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » How to setup a Third-Party DNS Server on a Linux Server
  • screenshot 2020 03 21 at 22.44.04 1
    How to create a Microsoft HyperV checkpoint Virtualization
  • drivelock 1280x720 1
    The server could not be reached or validated: Timeout expired. The Time out expired prior to obtaining a connection from the pool Security | Vulnerability Scans and Assessment
  • Featured image MSDT.
    How to restrict additional Microsoft Support Diagnostic Tool Downloads on Windows Windows
  • Create AWS RDS instance
    How to create an Amazon Relational Database Service Instance AWS/Azure/OpenShift
  • GPO Blocked Downloads 3
    How to Block downloads on Microsoft Edge using GPO on Windows Server 2019 and 2022 Windows
  • how to install software packages from source files
    How to install a software package from source file in Linux Linux
  • Azure Storage 1
    Azure CLI: How To Upload Batch Files to Azure Storage Account AWS/Azure/OpenShift
  • maxresdefault 2 7
    How to record your screen with PowerPoint and make slide shows Mac

How to setup a Third-Party DNS Server on a Linux Server

Posted on 25/10/202216/12/2023 Imoh Etuk By Imoh Etuk No Comments on How to setup a Third-Party DNS Server on a Linux Server
Header-image

In this guide, I will cover how to setup a Third-Party DNS Server on a Linux Server. Leveraging Linux for your Internet services not only provides you with stability but is also financially sensible due to Linux’s minimal cost. For a wide range of reasons, people are beginning to use Linux as their Internet servers. Please see Domain Name System: How to create a DNS record, The following error occurred when DNS was queried for the service location (SRV): Error code 0x0000232B RCODE_NAME_ERROR.

If you want to use Linux as your networking solution, you can set up a variety of services that will provide you with a stable and appropriate server environment. In addition to basic Web hosting, FTP, and e-mail services, Linux includes Domain Name System (DNS) services.

In this Daily Drill Down, I’ll show you how to set up a DNS server on your Linux system. There are numerous resources available to assist you in setting up a DNS server, but some of them can be challenging to comprehend and also too complicated. In order to improve your Internet hosting services, I’ll give you explicit steps for setting up a DNS server in this post.

Before I proceed to the demonstration steps, DNS helps in converting text-based domain names to numeric IP addresses. The internet service provider provides DNS servers, and most networks use them by default.

Users can modify the DNS nameservers at any time. For example, the domain name http://www.mydomain.com might translate to 198.168.233.6. This process is the backbone of the internet and is very important to the server.

Configuring DNS

One should first be familiar with DNS fundamentals and their operation before configuring DNS on a Linux system.

Domain Name – Think about the www.techdirectarchive.com webpage. The dot distinguishes these components, forming each domain, and people know this as FQDN (Fully Qualified Domain Name). The top-level domain element is the text "com"followed by the second-level domain element "techdirectarchive" and the third-level domain element "www". The dot is called the root domain.

Subdomains – Whenever you visit a website such as blog.techdirectarchive.com. The blog part of the domain name is the subdomain of that website. The root name servers have no idea if there is a blog subdomain or not; only the name servers for blog.techdirectarchive.com are aware of all the hosts that exist within it.

Types of DNS Servers

Three different kinds of DNS servers exist:

Primary DNS servers: The master copy of the domain’s configuration files is stored on the primary DNS server. They provide details on the administrator as well as IP addresses.

Secondary DNS server (slave): These servers receive domain information from the primary DNS server and store a read-only copy of it on their systems. This is helpful since the secondary server serves as a backup when the original server is down.

Caching DNS server: A DNS server cache stores information about recently-requested user queries to lighten the burden on primary and secondary servers.

DNS server Configuration

Let's get started. 

Learn more by referring to the following posts: How to set up a cache-only DNS server, DNS Bad key 9017: The Cluster Name registration failed of one or more associated DNS names, and What happens when WDS and DNS are installed on the same Windows Server? DNS issues with WDS.

Step 1 – Install BIND

First, we need to install the BIND packages with their dependencies. BIND is the Berkley Internet Naming Daemon. The most popular application for running a name server on Linux is BIND. Use the following syntax on Debian/Ubuntu Linux to install bind:

$ sudo apt-get install bind9
Domain Name Server
Install BIND on Ubuntu

Use the following syntax on a Redhat, CentOS, or Fedora machine:

# yum install bind9

The DNS configurations are all stored in the /etc/bind directory. The main configuration file /etc/bind/named.confcontains all other required files. The root nameservers in the world are listed in the file /etc/bind/db.root.

Step 2 – Start and Enable DNS

After completing the installation you can start it and enable it to run at boot time using the following commands.

$  systemctl  start named
$  systemctl  enable named
Name Resolution Server
Start and Enable the Service
Step 3 – Configuring BIND

The service configuration file is  /etc/named.conf file.

Defining Primary DNS server

The syntax is as follows for defining the primary zone in the /etc/named.conf file. To edit the named.conf file, you need to navigate to the /etc/bind directory using the cd command.

$ cd /etc/bind
Domain Name System Server
Configuring Files

Now, use the nano editor to view the content of the name.conf files:

Internet Naming Server
Named. conf files

The files include three file directories. If you want to see the default primary DNS defined and add your Primary DNS, use the nano or vim editor to make changes to the /etc/bind/named.conf.default-zones by adding files similar to the one shown below:

zone  "techdirectarchive.com" {
       type master;
      file "techirectarchive.com.db";
 };

Add Primary DNS

Added-Primary-DNS
Added Primary DNS

After adding it press Ctrl + O to save it and press Ctrl + x to exit the nano editor interface.

Using the zone statement, you can specify a specific DNS zone. The file with the zone information can be found in the /var/named directory. The type is master because this is the main zone.

Defining Second DNS server

Since this is a secondary zone, the domain name is identical to the one in the primary zone, and the type is slave. The primary name server’s IP addresses can be specified by the master, and the file specifies the location of the primary zone files.

Defining DNS Caching

In the DNS Caching section, the DNS server receives fewer requests thanks to the caching zone. We must declare three-zone sections in order to define a caching zone.

Zone    "." IN {
        type hint;
        file "root.hint";
};

Here the dot indicates the root name servers. The type hint indicates caching zone entry and the file “root.hint”; specifies the file that contains the root servers.

Secondary-Primary-DNS
Defining Secondary-Caching DNS

Now add the second section of the Caching DNS as shown above:

Zone     "localhost" IN {
         type master;
        file "localhost.db";
};

The third zone performs the reverse lookup for the localhost.

Zone  "0.0.127.in-addr.arpa" IN {
      type master;
      file "127.0.0.rev";
};

To function as a DNS cache server, we need to add these three zones to /etc/named.conf. The contents of the files techirectarchive.com.db, localhost.db and 127.0.0.rev should now be typed. These files hold the DNS record types for each zone with various settings. Check out those record types first.

Sometimes while configuring your DNS, you may run into errors. To troubleshoot errors relating to DNS configuration, run the below command:

$ tail -f /var/log/messages

I hope you found this blog post on how to setup a Third-Party DNS Server on a Linux Server helpful. Please let me know in the comment session if you have any questions.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Pocket (Opens in new window) Pocket
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Linux, Network | Monitoring Tags:DNS, Internet

Post navigation

Previous Post: How to deploy MBAM Client as part of a Windows Deployment
Next Post: Create Chocolatey Package: Upgrade Software with Chocolatey

Related Posts

  • Webp.net resizeimage 1
    Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
  • DNS FEATURE
    Domain Name System: All you need to know about DNS Linux
  • portainer feature
    How to Install Docker Portainer on Linux Containers
  • MM
    How to install Mattermost on Ubuntu and Debian Linux
  • finalelastic
    How to Install and Configure Elasticsearch on Linux  Linux
  • HAProxy
    Deploying a load balancer from scratch and adding backend servers Linux

More Related Articles

Webp.net resizeimage 1 Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
DNS FEATURE Domain Name System: All you need to know about DNS Linux
portainer feature How to Install Docker Portainer on Linux Containers
MM How to install Mattermost on Ubuntu and Debian Linux
finalelastic How to Install and Configure Elasticsearch on Linux  Linux
HAProxy Deploying a load balancer from scratch and adding backend servers Linux

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • screenshot 2020 03 21 at 22.44.04 1
    How to create a Microsoft HyperV checkpoint Virtualization
  • drivelock 1280x720 1
    The server could not be reached or validated: Timeout expired. The Time out expired prior to obtaining a connection from the pool Security | Vulnerability Scans and Assessment
  • Featured image MSDT.
    How to restrict additional Microsoft Support Diagnostic Tool Downloads on Windows Windows
  • Create AWS RDS instance
    How to create an Amazon Relational Database Service Instance AWS/Azure/OpenShift
  • GPO Blocked Downloads 3
    How to Block downloads on Microsoft Edge using GPO on Windows Server 2019 and 2022 Windows
  • how to install software packages from source files
    How to install a software package from source file in Linux Linux
  • Azure Storage 1
    Azure CLI: How To Upload Batch Files to Azure Storage Account AWS/Azure/OpenShift
  • maxresdefault 2 7
    How to record your screen with PowerPoint and make slide shows Mac

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.