Friday, June 28, 2013

DNS-SERVER (Domain Name Server )

                                    DNS-SERVER 
                    ========================================

DNS       - Domain  Name  Server 
 
PORT NO.  - 53, 953

BPACKAGE  - bind [barklay Internet Naming Domain ] 

DEAMON    - named   
-------------------------------------------
    IP ADD. IS  = 192.168.0.1
    FQDN        = server1.deo.com    [Where  FQDN - Fully      Qualified Domain Name ] 
    DOMAIN NAME = deo.com
    NEBIOS NAME = server1.
-------------------------------------------
    STEP (1) Configure the 'ifcfg-eth0/1' file first 
   
    #vim  /etc/sysconfig/network-scripts/ifcfg-eth0

    DEVICE=eth0
    HWADDR= 00:0C:29:84:6D:8C
    NM_CONTROLLED=no
    ONBOOT=yes
    IPADDR=192.168.0.1
    BOOTPROTO=none
    NETMASK=255.255.255.0
    DNS=192.168.0.1
    TYPE=Ethernet
    IPV6INIT=no
    USERCTL=no

    :wq  [save the file ] 


    STEP (2) Configure the "/etc/sysconfig/network"
   

    #vim  /etc/sysconfig/network
   
    NETWORKING=yes
    HOSTNAME=server1.deo.com

    :wq   [save the file ] 


    STEP (3) Configure the /etc/hosts

    #vim  /etc/hosts

    192.168.0.1    server1.deo.com        server   

    :wq  (save the file )    

    #hostname  server1.deo.com


    STEP (4) Configure the  "/etc/resolv.conf"


    search station.example.com
    nameserver   192.168.0.1
   
    :wq  [ save ] 

*Install the package of 'bind' 

    #yum install bind*  -y 

  ********************************************    

*Copy the sample file form the '/etc/named.*' in to the /var/named/chroot/etc/

    #cp -p /etc/named.*  /var/named/chroot/etc


    #cd  /var/named/chroot/etc


    #ll    (to see the all file ) 

*Configure the "named.conf" file 


    #vim  named.conf      

    liston-on  port 53 {127.0.0.1;192.168.0.1; };     (the rang of 127.0.0.1 we can keep or remove ) 

    allow-querry  { any; };  (here we can specify the particular IP range for the query like 192.168.0.0/24 )

    :wq   (now save the file for this configuration ) 



*Configure the "named.rfc1912.zones" file 


    #vim  named.rfc1912.zones  


*Copy and past the 5 line of for 'forword zone' and 5 line for 'reverse zone in named.rfc1912.zones

             [forword zone ] 

    zone  "example.com " IN  {

    type  master ;

    file "for.zone" ; 

    allow-update {none;};

    }; 


   
         [revers zone] 

    zone  "0.168.192.in-addr.arpa"  IN {

    type   master ;

    file   "rev.zone"; 

    allow-update  { none } ; 

    } 

    :wq     (save the file ) 



*Copy the file "/var/named/*  into the  " /var/named/chroot/var/named/ "


    #cp  -p /var/named/*  /var/named/chroot/var/named/


    #cd  /var/named/chroot/var/named/

    #ll   [To see the all file ] 


    #cp -p  named.localhost   for.zone

    #vim  for.zone 

    $TTL 1D

    @    IN SOA  deo.com.  root.deo.com. (            [ give only domain name not netbios name ] 

            0    ;serial
            1D    ;refresh
            1H    ;retry
            1W    ;expire
            3H)     ;minim    IN   NS       
           
    @    IN    NS    server1.deo.com.

    server1 IN    A    192.168.0.1

    :wq   (save the file ) 




    #cp -p named.loopback   rev.zone

    #vim  rev.zone 

    $TTL  1D

    @    IN SOA  deo.com.  root.deo.com. (

            0    ;serial
            1D    ;refresh
            1H    ;retry
            1W    ;expire
            3H)    ;minimum

    @    IN    NS    server1.deo.com. 
       
    1    IN    PTR    server1.deo.com.      [where  "1" is the last ip add of the server 192.168.0.1] 


    :wq   [save the file ] 
           

    #service  named restart  



    CLIENT SIDE 
=========================


* Configure the "/etc/resolv.conf

    #vim   /etc/resolv.conf

    search      deo.com

    nameserver  192.168.0.1   

    :wq  [ save the file ] 


   
    #nslookup  server1.deo.com

    server:        192.168.0.1

    Addres:        192.168.0.1#53



    #dig   -x   192.168.0.1 

        or 

    #dig   server1.deo.com


==============================

No comments:

Post a Comment