Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Contact
  • Reviews
  • Toggle search form
Home » Linux » How to setup a Third-Party DNS Server on a Linux Server
  • Linux Shell Scripting 1
    Write a Shell Script that Count Lines and Words in a File Linux
  • MBAM noncompliance
    How to determine why an MBAM-protected device is non-compliant Security | Vulnerability Scans and Assessment
  • Veeam Virtual Appliance for Backup and Restore
    How to setup Veeam Software Appliance v13 Backup
  • fba7f screenshot 2019 04 15 at 18.33.30
    File System Overview: How to decide on the right File System to use for your USB Linux
  • S3 Bucket Public Access 1
    How to grant public access to S3 Bucket using Policy AWS/Azure/OpenShift
  • download
    How to import Users and Groups into Pleasant Password Manager Password Manager
  • Security enhanced linux
    How to setup SELinux on a Linux server Linux
  • How to Migrate Windows Servers from Hyper V to Proxmox Correctly
    Migrate Windows Servers from Hyper V to Proxmox Correctly Backup

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

  • 980239e9 cisco logo
    Security Best Practice to secure your Cisco Router and Switches Network | Monitoring
  • featureunions
    How to Install Unison on Linux System Linux
  • 517443 637084112713220326 16x9 1
    How can I tell if a password is set for a user account on Linux Linux
  • Enhancing Proactive Monitoring with Veeam ONE
    Enhanced Proactive Monitoring with Veeam ONE Backup
  • cisco asa 5510
    Copying TFTP Image to Flash Network | Monitoring
  • Installgrafana
    Install Grafana on Windows and Windows Server Network | Monitoring

More Related Articles

980239e9 cisco logo Security Best Practice to secure your Cisco Router and Switches Network | Monitoring
featureunions How to Install Unison on Linux System Linux
517443 637084112713220326 16x9 1 How can I tell if a password is set for a user account on Linux Linux
Enhancing Proactive Monitoring with Veeam ONE Enhanced Proactive Monitoring with Veeam ONE Backup
cisco asa 5510 Copying TFTP Image to Flash Network | Monitoring
Installgrafana Install Grafana on Windows and Windows Server Network | Monitoring

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

  • Linux Shell Scripting 1
    Write a Shell Script that Count Lines and Words in a File Linux
  • MBAM noncompliance
    How to determine why an MBAM-protected device is non-compliant Security | Vulnerability Scans and Assessment
  • Veeam Virtual Appliance for Backup and Restore
    How to setup Veeam Software Appliance v13 Backup
  • fba7f screenshot 2019 04 15 at 18.33.30
    File System Overview: How to decide on the right File System to use for your USB Linux
  • S3 Bucket Public Access 1
    How to grant public access to S3 Bucket using Policy AWS/Azure/OpenShift
  • download
    How to import Users and Groups into Pleasant Password Manager Password Manager
  • Security enhanced linux
    How to setup SELinux on a Linux server Linux
  • How to Migrate Windows Servers from Hyper V to Proxmox Correctly
    Migrate Windows Servers from Hyper V to Proxmox Correctly Backup

Subscribe to Blog via Email

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

Join 1,832 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

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.