0% found this document useful (0 votes)
15 views

DNS Server Configuration - 05230128

Uploaded by

05230128.jnec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

DNS Server Configuration - 05230128

Uploaded by

05230128.jnec
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Royal Universities of Bhutan

Jigme Namgyal Engineering College


Deothang, Bhutan

Department of Information Technology

DNS Server Configuration

Module: Linux Network Services Administration


Module Tutor: Mr Tashi Tobgay
Date: 10/11/2024
Submitted By: Sangay Chhophey (05230128)
Network Details:
we will implement the DNS server within our virtual network setup. We will install the necessary
packages for the DNS server, proceed with its configuration, and finally test it. In this experiment,
we want to use the domain name csn.local; hence, the hostname of the DNS server is dns. The IP
address on the server will be set to 172.168.30.3 while the default gateway will be set to
172.168.30.1. This will also allow us to get to services by name instead of trying to remember IP
addresses using Fully Qualified Domain Names.

Page 2 of 12
Before proceeding, make sure the network adapter is set to NAT mode to allow proper network
communication.

Once you have changed it to NAT, make sure connectivity can be checked by pinging 8.8.8.8
for network connectivity and 'dhclient' to ensure that the system has obtained a valid IP address.
Once the connectivity is okay, then it's time to install packages required, followed by

Page 3 of 12
configuring a DNS server, and test whether it works or not.

BIND Package Installation:


BIND is available within the default CentOS repository, so it is easily installed via the YUM
utility. The main package that we will need is simply the bind package, but for problems
associated with DNS, this bind-utils package can be quite useful; so lets install both of these
packages. We can install them as such:

Configuration:
The main configuration file is located in the /etc/ directory and is called named.conf. The listen-
on option is configured to have the server listen for DNS queries on port 53 for IPv4 and IPv6,
including requests that may arise from the local machine at 127.0.0.1 and ::1 and on any other
network interface that might be present with the keyword 'any'.
allow-query is the setting allowing DNS queries from localhost and any external hosts, while
allow-query-cache allows the same host to query the cached data from the server.

Page 4 of 12
A configuration defines two zones, a forward zone for csn.local and a reverse zone for
30.168.172.in-addr.arpa. The DNS server is master for these zones, which means the forward
lookup records are held in the file forward.csn.local and the reverse lookup records in 30.168.172.
Because this server is authoritative for the zones, it will not allow external updates: allow-update
{none;}. There are also files in the configuration for root DNS hints and security settings.

After making the necessary edits, it is important to verify that everything is correctly typed or
configured without any typos. For that, execute this command: named-checkconf /etc/named.conf
If all is well, it would execute without incidents and without showing anything. And if there is
any problem, this would show an error message indicating what to correct.

Creation of Forward Lookup Zone file:


To actually create the forward lookup zone file after indicating it in the /etc/named.conf file, we
need to really make the actual zone files. These files by convention will be in the /var/named
directory and are named forward.csn.local and 30.168.172. We can create the forward zone file
using the command vim /var/named/forward.csn.local.

Page 5 of 12
To actually create the forward lookup zone file after indicating it in the /etc/named.conf file, we
need to actually make the actual zone files. These files, by convention, will be in the /var/named
directory and are named forward.csn.local and 30.168.172. We can create the forward zone file
using the command vim /var/named/forward.csn.local..

Creation of Reverse Lookup Zone file:


To make the reverse lookup zone file, we will create a file named 30.168.172 in the same folder
where the forward lookup zone file was kept, /var/named. The 30.168.172 file is very important
for the correct translation of IP addresses into domain names. We will change to the /var/named
directory and, using any text editor such as vim, create and open a file called 30.168.172.

Once you have filled the reverse lookup zone file with the required information, you should have
it checked for errors. This is done by running the namedcheckzone 30.168.172
/var/named/30.168.172 command, which will check the eponymous file named 30.168.172 for the
reverse lookup zone for any configuration errors. If everything is okay, the command will execute

Page 6 of 12
without showing any errors.

Starting and Enabling the named Service:


The command # systemctl restart NetworkManager is actually used to restart the
NetworkManager service on a Linux system using systemd. Such a command is useful in cases
when you have altered something in the network configurations and want it to take effect without
needing to reboot the whole system.

With the zone files in place, you should start and enable the named service so that it
automatically starts at boot. You can accomplish this with the following commands: systemctl
start named && systemctl enable named This should start the service without problems unless
there are configuration issues in the named configuration files.

Firewall Adjustment:
The following commands configure the necessary DNS traffic through the firewall on a Linux
system: first to open port 53 for both TCP and UDP, firewall-cmd --permanent --zone=public --
add-port=53/{tcp,udp}, and then add the service for DNS, firewall-cmd --permanent --
zone=public --add-service=dns. Lastly, execute firewall-cmd --reload to enact the changes.

Page 7 of 12
Assigning Static IP Address to Server:
To assign a static IP address to a DNS server using nmtui, open the interface by typing nmtui in
the terminal and select Edit a connection.

Page 8 of 12
After that, change the network adapter back to generic driver on both server and client.

After assigning a static IP address to the client and configuring the network adapter with a
generic driver, the next step is to test the network connectivity by pinging the server’s IP address

Page 9 of 12
(172.168.30.4 and 712.168.30.3). This ensures that the client can communicate with other
devices on the network.

It is important to give preferred DNS server to client.

Page 10 of 12
Testing the Functionality:
To test whether the client can access files and folders on the FTP server (IP: 172.168.30.4,
Domain: ftp.csn.local) through a web browser, start by ensuring that the FTP service is running
and properly configured on the server.
On the client machine, open a web browser and type either the domain (ftp://ftp.csn.local) or IP
address (ftp://172.168.30.4) into the address bar. If it is successful, client will be able to see
directories and access it.

Page 11 of 12
Page 12 of 12

You might also like