Horje
How to Configure DNS on Linux?

Configuring DNS in Linux is an essential task for ensuring your system can resolve domain names correctly and access the internet smoothly. Whether you are setting up a DNS server, changing DNS settings, or troubleshooting network issues, understanding how to configure DNS in Linux is crucial.

In this guide, we will provide a step-by-step tutorial on how to set up and configure DNS in Linux, covering various methods and tools to help you achieve optimal DNS performance.

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

Configuring DNS in Linux is a straightforward process that can greatly enhance your system’s network performance and reliability. By following the steps outlined in this guide, you can easily set up and manage DNS settings on your Linux system. As Linux has the Linux Command Line Tool, this complex process can be completed with a couple of Linux Commands.

Also Read

How to Configure DNS on Linux – FAQs

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.

Can I use public DNS servers in Linux?

Yes, you can use public DNS servers such as Google DNS (8.8.8.8, 8.8.4.4) or Cloudflare DNS (1.1.1.1) by configuring them in your DNS settings.

How do I Configure a DNS server in Linux?

Configuring a DNS server involves setting up software like BIND or dnsmasq, configuring zone files, and ensuring your server is properly secured. The guide covers basic steps to get started.

How do I troubleshoot DNS issues in Linux?

Troubleshooting DNS issues involves checking your DNS configuration files, using tools like nslookup, dig, or ping, and ensuring your network connection is stable.




Reffered: https://www.geeksforgeeks.org


TechTips

Related
How to Set Up Windows 11 Remote Desktop Access? How to Set Up Windows 11 Remote Desktop Access?
How to Set Up Multiple Desktops in Windows 7, 8 and 10? How to Set Up Multiple Desktops in Windows 7, 8 and 10?
How to Change and Customize Keyboard Shortcuts in Windows 11 How to Change and Customize Keyboard Shortcuts in Windows 11
How to Use Windows 11 Magnifier for Accessibility? How to Use Windows 11 Magnifier for Accessibility?
How to Set Up a VPN in Windows 11? How to Set Up a VPN in Windows 11?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
12