一 安裝 bind
[root@slave slaves]# rpm -qa | grep bind
bind-libs-9.3.6-4.P1.el5_4.2
bind-sdb-9.3.6-4.P1.el5_4.2
bind-devel-9.3.6-4.P1.el5_4.2
bind-libbind-devel-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2
bind-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
ypbind-1.19-12.el5
二 配置DNS的配置文件
1 vim /var/named/chroot/etc/named.conf
options {
directory "/var/named";
};
zone "wang.com" {
type master;
file "wang.com.zone";
allow-transfer {192.168.18.171;};
};
2 vim wangbo.com,zone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
wang.com. IN NS master.wang.com.
wang.com. IN NS slave.wang.com.
master.wang.com. IN A 192.168.18.172
slave.wang.com. IN A 192.168.18.171
3 vim wangbo.com.192.168.23
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
@ IN NS master.wang.com.
172 IN PTR www.wang.com.
客戶端上安裝BIND配置 輔助DSN 配置文件
[root@master named]# rpm -qa | grep bind
bind-libs-9.3.6-4.P1.el5_4.2
bind-sdb-9.3.6-4.P1.el5_4.2
bind-devel-9.3.6-4.P1.el5_4.2
bind-libbind-devel-9.3.6-4.P1.el5_4.2
bind-utils-9.3.6-4.P1.el5_4.2
bind-9.3.6-4.P1.el5_4.2
bind-chroot-9.3.6-4.P1.el5_4.2
ypbind-1.19-12.el5
1 vim /var/named/chroot/etc/named.conf
options {
directory "/var/named";
};
zone "wang.com" {
type slave;
file "slaves/wang.com.zone";
masters {192.168.18.172;};
};
測試
[root@master named]# host master.wang.com
master.wang.com has address 192.168.18.172
在客戶端測試輔助DNS
[root@slave slaves]# host master.wang.com
master.wang.com has address 192.168.18.172
[root@slave ~]# cd /var/named/chroot/var/named/slaves/
[root@slave slaves]# ls
wang.com.zone
在轉發器上
vim /var/named/chroot/etc/named.conf
options {
directory "/var/named";
recursion yes;
forwarders {192.168.18.172;};
forward only;
};
[root@slave slaves]# host master.wang.com
master.wang.com has address 192.168.18.172