Pages

Sunday, September 4, 2011

DNS Sever Configuration in RHEL5



Requirements of DNS Server Configuration
         Software’s               : bind* cach *
         Config. Files (1)     : /etc/named.rfc1912.zones
                                          :/etc/named.caching-nameserver.conf
         Port no                    :  53
         Service & Daemon :named
---------------------------------------------------------------------------------------------
                                  Configuration of DNS Server
---------------------------------------------------------------------------------------------
                                     Server System:


Check & Change Hostname : 
           
                       #vi /etc/hosts
                      #vi /etc/sysconfig/network

Checking the packages:
                   
                   #rpm -q bind
                   #rpm -q caching-nameserver
                   #rpm -q bind-utils
                   #rpm -q bind-chroot

Enter into Config file (1) to set Forward Lookup Zone(FLZ) & Reverse Lookup Zone(RLZ) :

               #vi  /etc/named.rfc1912.zones
:set nu
From 21st line copy 11 lines i.e; 11yy & paste them at last line(Shift g & p)
& change parameters from 50th-60th lines
i.e; zone “linuxtech4u.com” IN {
          type master;
          file “for.linuxtech4u”;
          allow-update{none;};
          };
Zone “0.168.192.in-addr.arpa” IN{
          Type master;
          File “rev.linuxtech4u”;
          Allow-update{none;};
};
:wq(save & quit).

Copy & Configure FLZ & RLZ :
                      
                  #cd /var/named/chroot/var/named
To copy FLZ:
                  #cp –p localhost.zone for.linuxtech4u
To copy RLZ
                  #cp –p named.local rev.linuxtech4u
To Configure FLZ :
                
 #vi for.linuxtech4u

SOA  server.linuxtech4u.com.
NS    server.linuxtech4u.com
Master        A       192.168.0.254
: wq (save & exit).

To Configure RLZ

#vi rev.linuxtech4u
                  
 SOA  server.linuxtech4u.com.
                  
                   NS     server.linuxtech4u.com.
254             PTR  server.linuxtech4u.com

Note: In this file replace local host with FQDN
i.e. :1, $s/localhost/server.linuxtech4u.com.
: wq (save & exit).

Provide Self System IP in resolv file :

#vi /etc/resolv.conf
nameserver 192.168.0.254

In config file (2) provide Self & Client systems ip :

#vi /etc/named.caching-nameserver.conf
: set nu
In 15 th line no. provide self system ip
In 23 rd & 32 nd line no’s provide client ip’s 192.168.0.0/24
: wq (save & exit).

Restart service to activate changes :
#service named restart
#chkconfig named on

To check try to dig FLZ :

#dig hostname
#dig server.linuxtech4u.com

To check RLZ :
#dig –x ip
#dig –x 192.168.0.254

Note: If the answer comes “1” DNS is configured correctly & if answer comes “0” DNS is not configured properly.
---------------------------------------------------------------------------------------------
                                 Client system :

#  vi /etc/resolv.conf
         
          192.168.0.254
         
          : wq

To check FLZ :
#dig hostname of DNS

To check RLZ
#dig –x .
*****************************************************************
To check from Windows client
In windows client, provide dns ip in TCP/IP, primary dns column -192.168.0.254.
To check in Windows
Go to start – run – cmd
nslookup server.linuxtech4u.com (FLZ)
nslookup 192.168.0.254(RLZ)
 ********************************************************************************

No comments:

Post a Comment