[root@bind ~]# yum install bind [root@bind ~]# vi /etc/named.conf // // named.conf // // Provided by Red Hat bind 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. // options { listen-on port 53 { any; }; 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 no; dnssec-validation no; /* Path to ISC DLV key */ bindkeys-file “/etc/named.iscdlv.key”; managed-keys-directory “/var/named/dynamic”; }; logging { channel default_debug { file “data/named.run”; severity dynamic; }; }; zone “.” IN { type hint; file “named.ca”; }; zone “tidepharm.cn” IN { type master; file “tidepharm.cn.zone”; }; include “/etc/named.rfc1912.zones”; include “/etc/named.root.key”;
[root@bind ~]# cd /var/named/ [root@bind named]# cp named.localhost tidepharm.cn.zone [root@bind named]# vi tidepharm.cn.zone $TTL 86400 @ IN SOA tidepharm.cn. admin.tidepharm.cn. ( 42 ; serial 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum IN NS ns.tidepharm.cn. ns IN A 192.168.1.250 king IN A 192.168.1.251 king IN A 192.168.1.252 king IN A 192.168.1.253
[root@bind named]# chown root:named tidepharm.cn.zone [root@bind ~]# /etc/init.d/named start [root@bind ~]# chkconfig named on [root@bind ~]# chkconfig named --list named 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@king01 ~]# vi /etc/resolv.conf search tidepharm.cn nameserver 192.168.1.250 [root@king01 ~]# vi /etc/nsswitch.conf hosts: files dns [root@king01 ~]# nslookup king.tidepharm.cn Server: 192.168.1.250 Address: 192.168.1.250#53 Name: king.tidepharm.cn Address: 192.168.1.251 Name: king.tidepharm.cn Address: 192.168.1.252 Name: king.tidepharm.cn Address: 192.168.1.253
[root@king02 ~]# vi /etc/resolv.conf search tidepharm.cn nameserver 192.168.1.250 [root@king02 ~]# vi /etc/nsswitch.conf hosts: files dns [root@king02 ~]# nslookup king.tidepharm.cn Server: 192.168.1.250 Address: 192.168.1.250#53 Name: king.tidepharm.cn Address: 192.168.1.251 Name: king.tidepharm.cn Address: 192.168.1.252 Name: king.tidepharm.cn Address: 192.168.1.253