CentOS 6.3 DNS Server Master&Slave Setting
安裝DNS套件:Master&Slave 都要裝Bind、Bind-chroot
- Master:
[root@node1 /]# yum install bind bind-chroot //安裝DNS套件
[root@node1 /]# vim /etc/named.conf //修改DNS設定檔
將底下兩行MARK,不然只有local可以listen
#listen-on port 53 { 127.0.0.1; };
#listen-on-v6 port 53 { ::1; };
allow-query { any; }; //允許所有人來查
………….
zone "master.com.tw" IN {
type master;
file "named.master";
allow-transfer { 192.168.1.2; }; //允許轉送
notify yes; //自動更新
also-notify { 192.168.1.2; }; //自動更新至slave
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "named.192.168.1";
allow-transfer { 192.168.1.2; }; //允許轉送
notify yes; //自動更新
also-notify { 192.168.1.2; }; //自動更新至slave
};
2.Slave:
[root@node2 /]# yum install bind bind-chroot //安裝DNS套件
[root@node2 /]# vim /etc/named.conf
zone "ecbo.com.tw" IN {
type slave;
masters { 192.168.1.1; };
file "slaves/named.master"; //檔案路徑
allow-notify { 192.168.1.1; }; //自動接收Master更新
};
zone "1.168.192.in-addr.arpa" IN {
type slave;
masters { 192.168.1.1; };
file "slaves/named.192.168.1"; //檔案路徑
allow-notify { 192.168.1.1; }; //自動接收Master更新
};
3.將nameserver指為自己
[root@node1 named]# vim /etc/resolv.conf
nameserver 192.168.1.1
4.重啟named 就會同步到 Slave
service named restart
留言列表