May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

BIND CHROOT

########################  DNS CONFIGURATION ########
1. DNS Server Name: rhel5test.linux.com (192.168.1.21) ;  domain: linux.com
2.  Download and Install Packages related to bind:
      yum install bind*
      bind-utils, bind-sdb, bind-libs, bind-9.3, bind-chroot, bind-libbind-devel
      yum install caching-nameserver
3.  Configure : name.conf file  ( main configuration file )
     cd /var/named/chroot/etc/
     cp  named.caching-nameserver.conf  named.conf
     vi named.conf
     options  {
listen­on port 53 {  127.0.0.1; 192.168.1.21;   };
listen­on­v6 port 53 { ::1; };
directory “/var/named”;
dump­file “/var/named/data/cache_dump.db”;
statistics­file “/var/named/data/named_stats.txt”;
memstatistics­file “/var/named/data/
named_mem_stats.txt”;
            query­source port 53;
            allow-query {  127.0.0.1; 192.168.1.0/24;  };
allow­query {  127.0.0.1;  192.168.1.0/24;  };
  allow­transfer {  127.0.0.1; 192.168.1.21;   };
forwarders {   127.0.0.1; 192.168.1.21;   };
forward only;
};
logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};
view localhost_resolver {
match­clients { localhost; 192.168.1.0/24; };
match­destinations { localhost; 192.168.1.0/24;  };
recursion yes;
include “/etc/named.rfc1912.zones”;
};
==>  Copy named.conf to /etc/ dir
4.  Configure Zone files
       vi  /etc/named.rfc1912.zones
zone “linux.com” IN   {
type master;
file “linux.com.fzone”;
allow-update  {  none;  };
allow-query    {   any;  };
};
           zone  “1.168.192.in-addr.arpa”  IN  {
type master;
file “linux.come.reverse”;
allow-update  {  none;  };
allow-query    {   any;  };
           };
5.     cd /var/named/chroot/var/named   ;;   cp localhost.zone  linux.com.fzone ;;  cp named.local linux.come.reverse
6.     Change ownership to root:named and permission to 755 for following files
        Both zone files ,  named.conf  (both at /etc/ and /var/named/chroot/etc/)
        /etc/named.rfc1912.zones
7.    Edit Forward zone file ( Take care of dots after fqdns )
     $TTL 86400
@ IN SOA rhel5test.linux.com. root. rhel5test.linux.com. ( 42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS rhel5test.linux.com
.
rhel5test.linux.com. IN A 192.168.1.21
rhel6test.linux.com. IN A 192.168.1.22 # Client
8.   Edit Reverse Zone file  (Take care of dots after fqdns )
      $TTL 86400
@ IN SOA rhel5test.linux.com. rhel5test.linux.com. ( 1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
@ IN NS rhel5test.linux.com.
21 IN PTR rhel5test.linux.com.
22 IN PTR rhel6test.linux.com. # Client
9..   Check config file :  service named configtest
10.  Restart named services
11.  Test DNS using  dig server name ;  dig -x  server IP , nslookup
12  Client SIDE :: Make changes in /etc/resolv.conf :::   search  linux.com
    nameserver  192.178.1.21

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>