TP DNS 24-25
TP DNS 24-25
Server on Ubuntu
2024-2025
Introduction :
A DNS (Domain Name Service) is used for domain name resolution into an IP address. This
means that a domain name is associated with an IP address. DNS servers allow the
transformation of complicated IP addresses into easily memorable domain names. For example,
the IP address 172.217.22.131 corresponds to the domain name google.fr, which is much easier
to remember.
Goals :
In this lab, we will install and configure a DNS server using Bind 9, which will manage the
"esprit1.com" zone along with with its reverse zone.
Additionally, we will cover the integration between the DNS server and a web server.
Before we install any packages, we will first update download and install the latest updates with
the apt update and apt upgrade commands :
sudo su
apt update -y && apt upgrade -y
After installation, the BIND 9 service should be running. We check the status with this
command :
1
Step 4- Edit the named.conf.options file
The named.conf file is BIND 9's main configuration file.
You'll make four modifications to the /etc/bind/named.conf.options file :
To make those changes, open /etc/bind/named.conf.options in a text editor and modify the files
to look similar to this:
After you make the changes, check the syntax of the file with the named-checkconf command
:
sudo named -V
sudo ss -lnptu | grep named
sudo systemctl restart named
sudo systemctl enable named
2
Step 5- Edit the named.conf.local file
The named.conf.local is typically used to define local DNS zones for a private domain. We will
update this file to include our forward and reverse DNS zones.
To make the changes, open /etc/bind/named.conf.local in a text editor :
The named-checkconf command is used to check if the syntax is okay or if there is any error.
The command should return to shell if there is no error.
sudo named-checkconf
3
The acronyms on the file have the following description :
• SOA – Start of Authority
• NS – Name Server
• A – A record
• MX – Mail for Exchange
• CN – Canonical Name
136 corresponds to the last octet of the server's IP address. Replace it with the one from your own IP address.
4
You should see output similar to :
5
You need to add the -x option to test the resolution from the reverse DNS zone :
2. Edit the /etc/hosts file and remove the entry for www.esprit1.com.