[root@master named]# yum -y install bind*
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Package 32:bind-libs-9.8.2-0.68.rc1.el6_10.3.i686 already installed and latest version
Package 32:bind-9.8.2-0.68.rc1.el6_10.3.i686 already installed and latest version
Package 32:bind-utils-9.8.2-0.68.rc1.el6_10.3.i686 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package bind-chroot.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
---> Package bind-devel.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
---> Package bind-dyndb-ldap.i686 0:2.3-8.el6 will be installed
---> Package bind-sdb.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
--> Processing Dependency: libpq.so.5 for package: 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686
--> Running transaction check
---> Package postgresql-libs.i686 0:8.4.20-8.el6_9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
bind-chroot i686 32:9.8.2-0.68.rc1.el6_10.3 updates 78 k
bind-devel i686 32:9.8.2-0.68.rc1.el6_10.3 updates 386 k
bind-dyndb-ldap i686 2.3-8.el6 base 71 k
bind-sdb i686 32:9.8.2-0.68.rc1.el6_10.3 updates 316 k
Installing for dependencies:
postgresql-libs i686 8.4.20-8.el6_9 base 206 k
Transaction Summary
================================================================================
Install 5 Package(s)
Total download size: 1.0 M
Installed size: 2.7 M
Downloading Packages:
(1/5): bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 78 kB 00:00
(2/5): bind-devel-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 386 kB 00:00
(3/5): bind-dyndb-ldap-2.3-8.el6.i686.rpm | 71 kB 00:00
(4/5): bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 316 kB 00:00
(5/5): postgresql-libs-8.4.20-8.el6_9.i686.rpm | 206 kB 00:00
--------------------------------------------------------------------------------
Total 354 kB/s | 1.0 MB 00:02
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : 32:bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686 1/5
Installing : 32:bind-devel-9.8.2-0.68.rc1.el6_10.3.i686 2/5
Installing : postgresql-libs-8.4.20-8.el6_9.i686 3/5
Installing : 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686 4/5
Installing : bind-dyndb-ldap-2.3-8.el6.i686 5/5
Verifying : 32:bind-devel-9.8.2-0.68.rc1.el6_10.3.i686 1/5
Verifying : 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686 2/5
Verifying : postgresql-libs-8.4.20-8.el6_9.i686 3/5
Verifying : 32:bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686 4/5
Verifying : bind-dyndb-ldap-2.3-8.el6.i686 5/5
Installed:
bind-chroot.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-devel.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-dyndb-ldap.i686 0:2.3-8.el6
bind-sdb.i686 32:9.8.2-0.68.rc1.el6_10.3
Dependency Installed:
postgresql-libs.i686 0:8.4.20-8.el6_9
Complete!
[root@master ~]#
[root@master etc]# scp named.conf /var/named/chroot/etc/
[root@master etc]# cd /var/named/chroot/etc/
[root@master etc]# ls
localtime named named.conf pki
[root@master etc]#
[root@master Desktop]# find / -name named.conf
/etc/named.conf
/usr/share/doc/bind-9.8.2/sample/etc/named.conf
[root@master etc]# service named restart
Stopping named: . [ OK ]
Starting named:
Error in named configuration:
zone ysc.edu/IN: loading from master file ysc.edu.zone failed: file not found
zone ysc.edu/IN: not loaded due to errors.
_default/ysc.edu/IN: file not found
zone 43.168.192.in-addr.arpa/IN: loading from master file 43.168.192.in-addr.arpa.zone failed: file not found
zone 43.168.192.in-addr.arpa/IN: not loaded due to errors.
_default/43.168.192.in-addr.arpa/IN: file not found
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone 1.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: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
[FAILED]
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&[cqie@slave01 Desktop]$ su root
Password:
[root@slave01 Desktop]# nslookup www.baidu.com
Server: 192.168.43.10
Address: 192.168.43.10#53
Non-authoritative answer:
www.baidu.com canonical name = www.a.shifen.com.
Name: www.a.shifen.com
Address: 183.232.231.172
Name: www.a.shifen.com
Address: 183.232.231.174
[root@slave01 Desktop]# yum -y install bind*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: ap.stykers.moe
* updates: ap.stykers.moe
base | 3.7 kB 00:00
extras | 3.3 kB 00:00
updates | 3.4 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package bind.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
---> Package bind-chroot.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
---> Package bind-devel.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
---> Package bind-dyndb-ldap.i686 0:2.3-8.el6 will be installed
---> Package bind-libs.i686 32:9.8.2-0.17.rc1.el6_4.6 will be updated
---> Package bind-libs.i686 32:9.8.2-0.68.rc1.el6_10.3 will be an update
---> Package bind-sdb.i686 32:9.8.2-0.68.rc1.el6_10.3 will be installed
--> Processing Dependency: libpq.so.5 for package: 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686
---> Package bind-utils.i686 32:9.8.2-0.17.rc1.el6_4.6 will be updated
---> Package bind-utils.i686 32:9.8.2-0.68.rc1.el6_10.3 will be an update
--> Running transaction check
---> Package postgresql-libs.i686 0:8.4.20-8.el6_9 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
bind i686 32:9.8.2-0.68.rc1.el6_10.3 updates 4.0 M
bind-chroot i686 32:9.8.2-0.68.rc1.el6_10.3 updates 78 k
bind-devel i686 32:9.8.2-0.68.rc1.el6_10.3 updates 386 k
bind-dyndb-ldap i686 2.3-8.el6 base 71 k
bind-sdb i686 32:9.8.2-0.68.rc1.el6_10.3 updates 316 k
Updating:
bind-libs i686 32:9.8.2-0.68.rc1.el6_10.3 updates 903 k
bind-utils i686 32:9.8.2-0.68.rc1.el6_10.3 updates 188 k
Installing for dependencies:
postgresql-libs i686 8.4.20-8.el6_9 base 206 k
Transaction Summary
================================================================================
Install 6 Package(s)
Upgrade 2 Package(s)
Total download size: 6.1 M
Downloading Packages:
(1/8): bind-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 4.0 MB 00:01
(2/8): bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 78 kB 00:00
(3/8): bind-devel-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 386 kB 00:00
(4/8): bind-dyndb-ldap-2.3-8.el6.i686.rpm | 71 kB 00:00
(5/8): bind-libs-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 903 kB 00:00
(6/8): bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 316 kB 00:00
(7/8): bind-utils-9.8.2-0.68.rc1.el6_10.3.i686.rpm | 188 kB 00:00
(8/8): postgresql-libs-8.4.20-8.el6_9.i686.rpm | 206 kB 00:00
--------------------------------------------------------------------------------
Total 1.4 MB/s | 6.1 MB 00:04
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : 32:bind-libs-9.8.2-0.68.rc1.el6_10.3.i686 1/10
Installing : 32:bind-9.8.2-0.68.rc1.el6_10.3.i686 2/10
Installing : postgresql-libs-8.4.20-8.el6_9.i686 3/10
Installing : 32:bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686 4/10
Installing : 32:bind-devel-9.8.2-0.68.rc1.el6_10.3.i686 5/10
Installing : 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686 6/10
Installing : bind-dyndb-ldap-2.3-8.el6.i686 7/10
Updating : 32:bind-utils-9.8.2-0.68.rc1.el6_10.3.i686 8/10
Cleanup : 32:bind-utils-9.8.2-0.17.rc1.el6_4.6.i686 9/10
Cleanup : 32:bind-libs-9.8.2-0.17.rc1.el6_4.6.i686 10/10
Verifying : postgresql-libs-8.4.20-8.el6_9.i686 1/10
Verifying : 32:bind-sdb-9.8.2-0.68.rc1.el6_10.3.i686 2/10
Verifying : 32:bind-chroot-9.8.2-0.68.rc1.el6_10.3.i686 3/10
Verifying : 32:bind-9.8.2-0.68.rc1.el6_10.3.i686 4/10
Verifying : 32:bind-devel-9.8.2-0.68.rc1.el6_10.3.i686 5/10
Verifying : 32:bind-libs-9.8.2-0.68.rc1.el6_10.3.i686 6/10
Verifying : bind-dyndb-ldap-2.3-8.el6.i686 7/10
Verifying : 32:bind-utils-9.8.2-0.68.rc1.el6_10.3.i686 8/10
Verifying : 32:bind-libs-9.8.2-0.17.rc1.el6_4.6.i686 9/10
Verifying : 32:bind-utils-9.8.2-0.17.rc1.el6_4.6.i686 10/10
Installed:
bind.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-chroot.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-devel.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-dyndb-ldap.i686 0:2.3-8.el6
bind-sdb.i686 32:9.8.2-0.68.rc1.el6_10.3
Dependency Installed:
postgresql-libs.i686 0:8.4.20-8.el6_9
Updated:
bind-libs.i686 32:9.8.2-0.68.rc1.el6_10.3
bind-utils.i686 32:9.8.2-0.68.rc1.el6_10.3
Complete!
[root@slave01 Desktop]# service named start
Generating /etc/rndc.key: [ OK ]
Starting named: [ OK ]
[root@slave01 Desktop]# vim /etc/named.conf
options {
listen-on port 53 { 192.168.43.79; };
// 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";
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
[root@slave01 Desktop]# vim /etc/named.rfc1912.zones
zone "ysc.edu" IN {
type master;
file "ysc.edu.zone";
};
zone "43.168.192.in-addr.arpa" IN {
type master;
file "43.168.192.zone";
};
[root@slave01 Desktop]# cd /var/named
[root@slave01 named]# ls
chroot dynamic named.empty named.loopback
data named.ca named.localhost slaves
[root@slave01 named]# cp named.localhost ysc.edu.zone
[root@slave01 named]# vim ysc.edu.zone
$TTL 1D
@ IN SOA dns.ysc.edu. root(
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS dns.ysc.edu.
dns IN A 192.168.43.79
[root@slave01 named]# cp named.localhost 43.168.192.zone
[root@slave01 named]# vim 43.168.192.zone
$TTL 1D
@ IN SOA dns.ysc.edu. root(
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS dns.ysc.edu.
79 IN PTR dns.ysc.edu.
[root@slave01 named]# service iptables stop
[root@slave01 named]# service named start
Starting named: named: already running [ OK ]
[root@slave01 named]# vim /etc/resolv.conf
domain localdomain
search localdomain
nameserver 192.168.43.79
[root@slave01 named]#
[root@slave01 named]# nslookup dns.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
[root@slave01 named]# chmod 644 43.168.192.zone
[root@slave01 named]# chmod 644 ysc.edu.zone
[root@slave01 named]# nslookup dns.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
** server can't find dns.ysc.edu: SERVFAIL
[root@slave01 named]# service named restart
Stopping named: . [ OK ]
Starting named: [ OK ]
[root@slave01 named]# nslookup dns.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
Name: dns.ysc.edu
Address: 192.168.43.79
[root@slave01 named]# nslookup 192.168.43.79
Server: 192.168.43.79
Address: 192.168.43.79#53
79.43.168.192.in-addr.arpa name = dns.ysc.edu.
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
WWW-S Server:192.168.43.216
vi /etc/resolv.conf
nameserver 192.168.43.79
[cqie@master Desktop]$ ping 192.168.43.79
PING 192.168.43.79 (192.168.43.79) 56(84) bytes of data.
64 bytes from 192.168.43.79: icmp_seq=1 ttl=64 time=0.425 ms
64 bytes from 192.168.43.79: icmp_seq=2 ttl=64 time=0.236 ms
64 bytes from 192.168.43.79: icmp_seq=3 ttl=64 time=0.435 ms
3 packets transmitted, 3 received, 0% packet loss, time 2170ms
rtt min/avg/max/mdev = 0.236/0.365/0.435/0.092 ms
[cqie@master Desktop]$ nslookup ysc.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
Name: ysc.ysc.edu
Address: 192.168.43.216
WWW-C Client:192.168.43.79
[root@slave01 named]# nslookup ysc.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
Name: ysc.ysc.edu
Address: 192.168.43.216
[root@slave01 named]# ls
43.168.192.zone data named.ca named.localhost slaves
chroot dynamic named.empty named.loopback ysc.edu.zone
[root@slave01 named]# vi ysc.edu.zone
@ IN NS dns.ysc.edu.
dns IN A 192.168.43.79
ysc IN A 192.168.43.216
[root@slave01 named]# nslookup dns.ysc.edu
Server: 192.168.43.79
Address: 192.168.43.79#53
Name: dns.ysc.edu
Address: 192.168.43.79