DNS Setup
Posted 09-16-2010 at 07:19 AM by prayag_pjs
Quote:
IP:192.168.20.3
login : root
password:********
login : root
password:********
Quote:
OS: CentOS-5
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
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
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
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
Total Comments 0