The DNS (Domain Name System - Domain Name System) allows network peripherals to translate IP addresses to domain names and vice versa, thanks to this is that when accessing a browser we enter the name of the site but not its IP, the DNS is essential in all current operating systems due to its functionality, there are some tasks that we can perform on DNS which in Linux acts as a service.
To clarify that Linux handles two types of DNS which are Bind 9 (for Debian, Ubuntu) and Named (Fedora, RHEL, CentOS), and we will talk a bit about both types of DNS..
Bind9 is an open source DNS system which has a MPL 2.0 license allowing developers to add new functions, Bind 9 is able to act as an authoritative name server, a DNS forwarder or add DNS zones, automatic signature of DNSSEC zones and key management, some of its features are:
DNSSEC Features
- RRL (Response Rate Limiting) function which has been added as an enhancement to named in order to deal with amplification attacks using DNS Response Rate Limiting
- Integrates DLZ (Dynamically-Loadable Zones) which allow BIND 9 to retrieve data directly from an external database
- Minimum responses at query level
- Minimum reload time thanks to remote name daemon (rndc)
- Adds catalog of Zones with various servers to use
- Integrates DNSTAP with which it is possible to capture and record DNS traffic
On the other hand, Named is the Internet domain name server integrated into RHEL-based distros and is part of the BIND 9 distribution. There may come a time when it is necessary to perform certain tasks on the DNS, whether it is slow, restarting, with connection failures, etc., TechnoWikis will explain these basic tasks of actions on the DNS and in this case we will use Ubuntu 22.04.
To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE
How to restart, stop or start DNS on Linux
Step 1
We open the terminal (and in the case of Debian and Ubuntu) to start the DNS we execute:
service bind9 start
Step 2
When executing this command we must enter the password:
Step 3
We will see that the command has been executed correctly:
Step 4
To stop the DNS we execute:
service bind9 stop
step 5
We must still enter the password:
step 6
We will see that the DNS has stopped:
step 7
To restart the DNS we execute:
service bind9 restart
step 8
After entering the password we will see that it has been done correctly:
This command is useful when the DNS presents failures and with a simple reboot it will be possible to solve multiple failures..
step 9
To reload the DNS we execute the following:
service bind9 reload
step 10
As in the previous cases, we must enter the password:
step 11
We will see that the DNS has been reloaded:
step 12
Reload allows the changes that have been made to the DNS to be applied correctly.
To see the DNS status we execute:
service bind9 status
step 13
Another option to do this with Bind 9 is by running:
/etc/init.d/bind9 start /etc/init.d/bind9 stop /etc/init.d/bind9 restart /etc/init.d/bind9 status
step 14
In the case of CentOS or Fedora we can do the following:
service named start service named stop service named restart
step 15
Either we see the state:
service named status
step 16
Furthermore it is possible to run:
/etc/init.d/named start /etc/init.d/named stop /etc/init.d/named restart
This is how we have worked on the DNS in Linux for its optimal functioning.