Saturday, December 6, 2014

DNS Server Step for Centos5/RHEL5

1 => # yum install cachi* (for caching )

2 => # yum install bind* ( Dependencies )

###########################################
3 => Configure DNS Server

 #vim /etc/named.caching-nameserver.conf

// named.caching-nameserver.conf
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
// See /usr/share/doc/bind*/sample/ for example named configuration files.
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
acl mylan {192.168.10.0/24; };
options {
listen-on port 53 { mylan; 192.168.10.1; };   #dns ip address
#  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;   
#  query-source-v6 port 53;
    allow-query     { mylan; localhost; };
};
logging {
        channel default_debug {
         file "data/named.run";
         severity dynamic;
        };
};

view localhost_resolver {
    match-clients        { mylan; localhost; };
    match-destinations { mylan; localhost; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
};


#save and exit

#########################################

4 =>

#vim /etc/named.rfc1912.zones

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
    type hint;
    file "named.ca";
};
###### By default we are using this for forward zone  #####
zone "localdomain" IN {         
    type master;
    file "localdomain.zone";
    allow-update { none; };
};

zone "localhost" IN {
    type master;
    file "localhost.zone";
    allow-update { none; };
};
###### I am using below for forward zone entry ######
zone "home.lab" IN {        
    type master;
    file "home.lab.frd";
    allow-update { mylan; };
};

######## By default Reverse zone entry ###########

zone "0.0.127.in-addr.arpa" IN {    
    type master;
    file "named.local";
    allow-update { none; };
};

####### I am using below for reverse zone #########

 zone "10.168.192.in-addr.arpa" IN {     
    type master;
    file "home.lab.rev";
    allow-update { none; };
};

zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
        type master;
    file "named.ip6.local";
    allow-update { none; };
};

zone "255.in-addr.arpa" IN {
    type master;
    file "named.broadcast";
    allow-update { none; };
};

zone "0.in-addr.arpa" IN {
    type master;
    file "named.zero";
    allow-update { none; };
};

save and exit

######################################

5 => Edit Reverse lookup file

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

#vim home.lab.rev

$TTL    86400
@       IN      SOA     pc1.home.lab. root.pc1.home.lab.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      pc1.home.lab.
1       IN      PTR     pc1.home.lab.

#save and exit

#########################################
6 => edit Forword lookup zone file

#vim home.lab.frd

$TTL    86400
@        IN SOA    pc1.home.lab. root.pc1.home.lab. (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum
            IN NS        pc1.home.lab.
pc1.home.lab.    IN     A        192.168.10.1
home.lab.    IN     A        192.168.10.1
@    IN     MX        10    pc1.home.lab.
pc1    IN    MX    10        pc1.home.lab.

################################################

7 => Restart Service

#service named restart
#chkconfig named on
#service network restart
#chkconfig network on

Check

#dig domain.com

No comments:

Post a Comment

Installing Jenkins on RHEL 8 is a straightforward process. Here's a step-by-step guide

Introduction  Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD) pipelines...