DNS Server Configuration - 05230128
DNS Server Configuration - 05230128
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.
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.
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..
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.
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.
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