LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > prayag_pjs
User Name
Password

Notices


Rate this Entry

DNS Setup

Posted 09-16-2010 at 07:19 AM by prayag_pjs

Quote:
IP:192.168.20.3
login : root
password:********
Quote:
OS: CentOS-5
Configuration settings:

Code:
# rpm -qa |grep -i bind
bind-9.3.3-7.el5
bind-libs-9.3.3-7.el5
ypbind-1.19-7.el5
bind-chroot-9.3.3-7.el5
kdebindings-3.5.4-1.fc6
bind-utils-9.3.3-7.el5

# vim /var/named/chroot/etc/named.conf

Code:
options {
directory "/var/named";               // Working directory of server
forwarders { 59.144.127.16;59.144.127.17; };
allow-query { any; };                 // Specify which hosts are allowed to query this server
allow-transfer { 192.168.20.0/24; };   // Specify hosts that are allowed to receive zone
                                        // transfers from this server
recursion yes;                        // Enable recursive queries
allow-recursion {192.168.20.0/24; };   // Specify which hosts can perform recursive queries.
version "Centos-5";  // Set version reported by ndc and when querying
                                         // version.bind in the chaos class
};

// The following controls who can access this server using rndc.
// Bind to 127.0.0.1 and allow only localhost access.
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

zone "." IN {                // Hints file containing root servers
        type hint;
        file "named.root";
};

zone "localhost" IN {
        type master;
        file "localhost.zone";

        allow-update { none; };
};

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

zone "example.com" IN {          // Forward lookup zone for xyz.com
        type master;         // This is a master zone
        file "fwd.zone";   // Zone information stored in /var/named/db.xyz.com
        allow-update { none; };
};

zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "rev.local";
        allow-update { none; };
};
                                  // information is kept locally on disk under /var/named.
include "/etc/rndc.key";     // Private key used for secure remote administration
#vim /var/named/chroot/var/named/fwd.zone

Code:
$TTL    86400
$ORIGIN example.com.
; If not specified, it's taken from named.conf
;  ns1 is a nameserver for the domain.  root is the
;  e-mail address of the owner of the domain.  The domain
;  is appended to each of these values since they don't
;  end with a period. (e.g. they become ns1.xyz.com
;  and root.xyz.com)
@           1D IN SOA server1.example.com. root.server1.example.com. (
                            2002011901      ;; serial
                            3H              ;; refresh
                            15M             ;; retry
                            1W              ;; expire
                            1D )            ;; minimum


; These two lines specify the same domain.
; @ means take it from the $ORIGIN or the zone
; specified in named.conf
;@                        IN NS     server1.example.com.
;example.com.         IN NS     server1.example.com.
;;server1.example.com.         IN NS     server1.example.com.

          IN NS     server1.example.com.
          IN NS     example.com.

server1                        IN A      192.168.20.3
production                  IN A      192.168.20.4
backup                        IN A      192.168.20.11
itdpc02                        IN A      192.168.20.102
itdpc03                        IN A      192.168.20.103
itdpc04                        IN A      192.168.20.104
itdpc05                        IN A      192.168.20.105
#vim /var/named/chroot/var/named/rev.local

Code:
$TTL    86400
@           1D IN SOA server1.example.com. root.server1.example.com. (
                            2002011901      ; serial
                            3H              ; refresh
                            15M             ; retry
                            1W              ; expire
                            1D )            ; minimum

; These two lines specify the same domain.
; @ means take it from the $ORIGIN or the zone specified in named.conf
              IN NS       server1.example.com.
              IN NS       example.com.
3            IN PTR       server1.example.com.
4            IN PTR       production.example.com.
11          IN PTR       backup.example.com.
Code:
# /etc/init.d/named restart
# chkconfig named on
Troubleshoot DNS :

Code:
# netstat -tulpn | grep :53

Code:
# netstat -atve |grep :53
#named-checkconf /var/named/chroot/etc/named.conf
# named-checkzone example.com /var/named/chroot/var/named/fwd.zone
Code:
# named-checkzone example.com /var/named/chroot/var/named/rev.local
Code:
#host www.example.com
Code:
# dig example.com
Posted in DNS-DHCP
Views 1920 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 10:37 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration