Press "Enter" to skip to content

How to configure and Test DNS server in Linux


Last updated on May 13, 2019

hey techies,

Welcome back !

today, we will learn - how to configure and test DNS in Linux along with CNAME,PTR and A record:

Before starting to configure DNS server make sure you are on the root by:
su - root

# first check whether DNS is installed or not by:
yum -y list bind

#my bind is already installed, otherwise we can install by:
yum -y install bind 

# now bind is installed, now we must open the. zones by and it will open the windows as shown in the fig 1.2.1:
less /etc/named.rfc1912.zones

Fig 1.2.1

# as shown in the fig 1.2.1, copy the selected part and edit the named.conf by:
nano /etc/named.conf

# at the end of the file paste that selected part and change the zone name into the file name as and as shown in the fig 1.2.2:

Fig 1.2.2

And change the option part, delete the localhost and keep ‘any’ so that it allows from anywhere not from only the localhost (ellingwood, 2014).

# now save the file CTRL + alt and CTRL+X
# now change the directory to /var/named by:
cd /var/named

# to check the files inside it just does:
ls -l

# to copy localhost to, simply do:
cp named.localhost

# to modify the, simply do:

# To configure the A and PTR record inside the, we simply do as show in the fig 1.2.3:

Fig 1.2.3

# Inside the, ns1 used in the second line gives the authoritative permission (ns1, 2013). And as shown in the fig NS gives the name server and IN gives the input and my Linux IP address as

# now add the input and record for java, wiki and win as shown in the fig 1.2.3

That's it, you are done !

Thanks for visiting see you again !

Your Comments are highly appreciated !

%d bloggers like this: