Sunday, January 13, 2019

DNS Server Installation Step by Step Using red hat enterprise linux 7


DNS server in RHLE 7



yum install bind*

vim /etc/named.conf

Change below lines:

Default line: listen-on port 53 { 127.0.0.1; };
Edited line: listen-on port 53 { 127.0.0.1; 192.168.20.230; }; [add you server IP]

Default line: allow-query     { localhost; };
Edited line: allow-query     { localhost; any; };

Default line: recursion yes;
Edited line: recursion no;



Copy below info format from (/etc/named.rfc1912.zones)

zone "localhost" IN {
        type master;
        file "named.localhost";
        allow-update { none; };
};




And edit like below.  vim /etc/named.conf

zone "xyz.com" IN {
        type master;
        file "xyz.fw.zone";
        allow-update { none; };
};





Go to cd /var/named/
Check list of files by using “ll” [Double L]

The result will be like this
drwxr-x--- 7 root  named   56 Nov 25 17:29 chroot
drwxrwx--- 2 named named   22 Nov 25 18:05 data
drwxrwx--- 2 named named   58 Nov 25 19:09 dynamic
-rw-r----- 1 root  named 2076 Jan 28  2013 named.ca
-rw-r----- 1 root  named  152 Dec 15  2009 named.empty
-rw-r----- 1 root  named  152 Jun 21  2007 named.localhost
-rw-r----- 1 root  named  168 Dec 15  2009 named.loopback
drwxrwx--- 2 named named    6 Jan 29  2014 slaves

Now we’ll copy the named.localhost file to the same name that we declare in name.conf file [file name was xyz.fw.zone]

cp named.localhost xyz.fw.zone

chown root:named xyz.fw.zone

vim xyz.fw.zone

We must edit this file like below

$TTL 60
@       IN SOA  reyaz.xyz.com. root. (
                                        01      ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
@       IN      NS      reyaz.xyz.com.

@       IN      A       192.168.20.230

reyaz   IN      A       192.168.20.230
 






Our DNS configuration done successfully, now check whether it’s working or not.

systemctl start named

systemctl status named

systemctl restart network

Done, now try to connect.


You can find me on Fiverr & LinkedIn



No comments:

Post a Comment