add next
# 正向解析
zone "test.com" {
type master;
file "/etc/bind/db.test";
allow-transfer { 192.168.1.109 ; }; #update slave server 192.168.1.109 db.test
notify yes;
also-notify { 192.168.1.109 ; };
};
#反向解析
zone "1.168.192.in-addr.arpa"{
type master;
file "/etc/bind/db.192.168.1";
allow-transfer { 192.168.1.109 ; }; #update slave server 192.168.1.109 db.test
notify yes;
also-notify { 192.168.1.109 ; };
};
1.3 add /etc/bind/db.test db.192.168.1
vim /etc/bind/db.test
#db.test
$TTL 86400
$ORIGIN test.com.
@ IN SOA test.com. root.test.com. (
20090201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
@ IN NS test.com.
www IN A 192.168.1.136
ftp IN A 192.168.1.107
#db.192.168.1
$TTL 86400
@ IN SOA test.com. root.test.com. (
20090201 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
@ IN NS test.com.
136 IN PTR www.test.com. #其中“.”加上
1.4 restart bind9 or reload named.conf config
/etc/init.d/bind9 restart
or
rndc reload
2. slave server configure
# ip: 192.168.1.109
2.1 install bind9
aptitude install bind9
2.2 config /etc/bind/named.conf
#add next
zone "test.com" {
type slave; #slave server
file "/etc/bind/db.test";
masters {192.168.1.107;}; #master server is 192.168.1.107
};
zone "1.168.192.in-addr.arpa"{
type master; #slave server
file "/etc/bind/db.192.168.1";
masters {192.168.1.107;}; #master server is 192.168.1.107
};
2.3 add /etc/bind/db.test /etc/bind/db.192.168.1
#copy there form master server 192.168.1.107
#if you want update slave server config, the "serial" must < serial on master server
2.4 change /etc/bind proteries
chown bind /etc/bind
#if you do not change, slalve can not update successfull. permission denied