Open In App

How to Configure DNS in Linux?

Last Updated : 15 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Quick Preview to Configure DNS on Linux:

  • Installing DNS Server Software.
  1. Open the Linux Terminal & execute the command sudo apt update
  2. later, execute the command sudo apt install bind9
  • Configuration of DNS Server on Linux:
  1. Add IP Address number to the DNS Named Config File using sudo nano /etc/bind/named.conf.options
  2. Add Forward & Reverse Lookup, execute command sudo nano /etc/bind/db
  3. Restart the Bind Server using the command sudo systemctl restart bind9
  4. Configure Bind with UTF Firewall using the command sudo utf allow bind9

Nowadays, working on the internet is as simple as putting some letters using a laptop or virtual keyboard on our smartphones, bringing up the list of endless web pages. This complete process can be executed with a proper DNS Configuration Process. The DNS Configuration on the Internet is used to change the IP Address to the Domain Name.

If you want to change the IP Address to DNS or DNS to IP Address, then the Configuration of DNS Server is an essential step. As a network administrator, you should have to Set Up DNS Configuration for Server. If you are using any Linux Device, then getting an understanding of DNS Configuration on Linux is important.

This article will discuss some basic facts about DNS Server Systems along with the steps to Turn On DNS Configuration on Linux.

Quick Highlights on DNS Server System:

  • The DNS Server stands for the Domain Name Server System.
  • The DNS Translate IP Address to Human Readable Domain Names.
  • DNS was first introduced in 1983, but in 1986, it got into the work.
  • DNS Works as the phonebook from where users can access different information online.
  • The DNS can change the Domain Name to the IP Address as well.
  • The DNS can change Web View as different computers can get attached there.
  • DNS Servers are divided into many different zones to look after major domains.

To know more about the DNS Theory & Working Process check the article What is Domain Name System(DNS)?

How to Install DNS Server Software on Linux?

Step 1: Open the Linux Terminal & execute the following command to update already installed packages on Linux.

Command: sudo apt update

1--Update

Step 2: At last, use the below-mentioned command to Install DNS Server BIND on Linux.

Command: sudo apt install bind9

2--Install-BIND

So, you have to perform these steps to Install BIND on Linux, if you have not performed it beforehand. Then, the following configuration process is stated.

How to Configure DNS on Linux?

To Enable DNS Server on Linux, the following configurations should be performed. We will start with configuring Named Config Files.

1) Configure DNS on Linux by Configuring the Named Config Files

Step 1: In the BIND Server, there are Config Files are present where we have to make the changes. To open such files the following command will be used.

Command: sudo nano /etc/bind/named.conf.options

3--Config-Files

Step 2: Now, under the Forwarders make the following changes as you can see in the image. We have to add the sample IP Address of Google.

4--Add-IP-Address

2) Configure DNS on Linux by Adding Forward & Reverse Lookup

Step 1: To add Forward & Reverse Lookup in Linux, the below-mentioned command will be used. It will open the file to make changes.

Command: sudo nano /etc/bind/db

5--Execute-Command

Step 2: Make the Serial Number Zero for the proper configuration there.

6--Change-Serial-Number

3) Configure DNS on Linux by Restarting BIND Server & Status

Step 1: It is time to Restart the BIND Server after making the changes. To do that, the following command should be used.

Command: sudo systemctl restart bind9

7--Restart-BIND

Step 2: Now, it is time to check the Status of the BIND Server that it is running now or not. To do that, the following command will be used.

Command: sudo systemctl status bind9

8--Check-Status

4) Configure DNS on Linux by Binding with UTF Firewall

Step 1: At last, the configuration with Uncomplicated Firewall (UTF) should be done. We will enable the UTF with BIND. For that purpose, the below command will be used.

Command: sudo utf allow bind9

9--Enable-UTF

Step 2: Now, if we are going to check the Status of the Firewall, we will find the BIND is added to the firewall which implies the end of the configuration.

Command: sudo utf status

10--UTF-Status

Conclusion

As we can see the Configuring DNS on Linux is not a cakewalk for everyone. Moreover, one needs to have proper knowledge of Computer Networking to work on the Linux DNS Configuration process. As Linux has the Linux Command Line Tool, this complex process can be completed with a couple of Linux Commands.

Also Read

Frequently Asked Questions to Configure DNS on Linux

How can I configure DNS on Linux?

If you have already installed DNS Server Software, you have to directly go to the DNS Configuration process on Linux. The steps included for the same are the following.

  1. Open Linux Terminal.
  2. Execute command sudo nano /etc/bind/named.conf.options to add IP Address number to the DNS.
  3. Execute command sudo nano /etc/bind/db to configure Forward & Reverse Lookup.
  4. Run the command sudo systemctl restart bind9 to restart the Bind Server.
  5. At last, use the command sudo utf allow bind9 to configure Bind with UTF Firewall.

How can I install DNS Server Software on Linux?

To install DNS Server Software on Linux, the best way to utilize the BIND on Linux. To install that use the following guideline.

  1. Open Linux Terminal.
  2. Execute command sudo apt update.
  3. Run the command sudo apt install bind9 to install.

What is BIND in Linux?

The BIND stands for the Berkeley Internet Name Domain which acts as the DNS Software. BIND is one of the free open server DNS Software that is highly used in the market. The BIND is used to cache DNS Servers as well as some authorized name servers. Load Balancing, Notification, and Dynamic Update are some of the features of BIND.



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads