DNS Lab
DNS Lab
Goals:
• Configure local resolver
• Configure an IPV4 DNS server.
• Integration part between DNS and WEB server.
Before we begin installation of the necessary packages, we run the updated Ubuntu server:
sudo -s
# apt update -y
2. Service installation
Download the necessary packages from Ubuntu base:
After installation, the BIND 9 service should be running. We check the status with this
command:
The named.conf file is BIND 9's main configuration file. That main file includes a reference to
/etc/bind/named.conf.options where we can specify options we need for our configuration. We'll
make four modifications to the /etc/bind/named.conf.options file:
#gedit /etc/bind/named.conf.options
After you make the changes, check the syntax of the file with the named-checkconf command:
#named-checkconf /etc/bind/named.conf.options
Note: If the syntax is correct, the command should not return any output.
Now update named service
#named -V
# ss -lnptu | grep named
#ufw allow in from 10.0.2.0/24 to any port 53
#ufw allow in from 192.168.121.0/24 to any port 53
Next, we'll create a directory to store the zone files we specified in the previous step.
Mkdir/etc/bind/zones
Now, we'll create a corresponding zone file /etc/bind/zones/esprit.tn. The forward zone file
allows the Bind DNS server to resolve names (like bindserver. esprit.tn) to IP addresses (like
10.0.2.15).
Now, we'll create a corresponding reverse zone file /etc/bind/zones/ esprit.tn.rev. The reverse
zone file allows the Bind DNS server to resolve IP addresses (like 10.0.2.15) to names (like
bindserver.esprit.tn). First, copy the default db.local zone file to /etc/bind/zones/ esprit.tn.rev
#cp /etc/bind/db.127 /etc/bind/zones/esprit.tn.rev
Open /etc/bind/zones/esprit.tn.rev in a text editor and make the changes indicated in the figure
below:
#gedit /etc/bind/zones/esprit.tn.rev
Note: The acronyms in the revese zone file are:
• PTR – Pointer
• SOA – Start of Authority
sudo named-checkconf
The named-checkzone command is used to check the syntax of the forward and reverse zone
files:
This is a working proof that both the forward and reverse zone lookups are working fine.
8. Integration Part
After testing the DNS server using DIG command now try to test the function of the four
sites created in TP1(web server) add the modification needed and check it using the browser.
On any client machine, change its DNS server to our newly deployed server. In our case, it is
10.0.2.15
9. Conclusion
We have successfully deployed a local DNS server on Ubuntu 22.04. So as an administrator in
your local network, you can now manage your systems and applications. You could have your
applications communicating via the domain names. When IPs changes, you have to re-configure
your applications.
10. References
[1] web_link1: https://www.cherryservers.com/blog/how-to-install-and-configure-a-private-bind-
dns-server-on-ubuntu-22-04