红联Linux门户
Linux帮助

DNS主从复制

发布时间:2016-02-02 00:56:25来源:红联作者:lythonmao
现在的环境是,虚拟机上建了三个网,
192.168.10.0/24
172.16.0.0/16
10.0.0.0/8

主DNS的IP是192.168.10.200 , 从DNS上有三个网卡,IP分别是172.16.100.200, 172.16.100.201, 172.16.100.202;

问题: 我想把 主DNS 配置好后,从DNS 把区域数据文件同步过来。现在主DNS服务器上有三个区域文件,telecom.maomao.com.zone, unicom.maomao.com.zone, other.maomao.com.zone; 前两个文件能够同步到从DNS服务器上,而other.maomao.com.zone却同步不过来?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------
1,主DNS的配置文件/etc/named.conf
[code]acl telecom {
127.0.0.1;
192.168.10.0/24;
};

acl unicom {
172.16.0.0/16;
};

acl other {
10.0.0.0/8;
};

options {
listen-on port 53 { telecom; };
directory "/var/named/";
allow-query { telecom; unicom; other; };
allow-recursion { telecom; unicom; other; };
notify yes;
};
view telecom_lan {

match-clients { telecom; 172.16.100.200; };
zone "maomao.com" IN {
type master;
file "telecom.maomao.com.zone";
allow-transfer { 172.16.100.200; };
};
};
view unicom_lan {
match-clients { unicom; 172.16.100.201; };
zone "maomao.com" IN {
type master;
file "unicom.maomao.com.zone";

allow-transfer { 172.16.100.201; };
};
};
view other_lan {
match-clients { other; 172.16.100.202; };
zone "maomao.com" IN {
type master;
file "other.maomao.com.zone";
allow-transfer { 172.16.100.202; };
};
};
[/code]


2, 从DNS的配置文件/etc/named.conf


[code]
acl telecom { 192.168.10.0/24; };
acl unicom { 127.0.0.1;
172.16.0.0/16;
};
acl other { 10.0.0.0/8; };

options {
listen-on port 53 { unicom; };
directory "/var/named";
allow-query { telecom; unicom; other; };
allow-recursion { telecom; unicom; other; };
};

view telecom_lan { transfer-source 172.16.100.200;
match-clients { telecom; };
zone "maomao.com" IN {
type slave;
file "slaves/telecom.maomao.com.zone";
masters { 192.168.10.200; };
};
};

view unicom_lan { transfer-source 172.16.100.201;
match-clients { unicom; };
zone "maomao.com" IN {
type slave;
file "slaves/unicom.maomao.com.zone";
masters { 192.168.10.200; };
};
};

view other_lan { transfer-source 172.16.100.202;
match-clients { other; };
zone "maomao.com" IN {
type slave;
file "slaves/other.maomao.com.zone";
masters { 192.168.10.200; };
};
};
[/code]

下面是主DNS的log
[code]
[root@localhost named]# tail /var/log/messages
Feb 1 17:42:23 localhost named[4640]: client 172.16.100.200#57110: view telecom_lan: transfer of 'maomao.com/IN': AXFR started
Feb 1 17:42:23 localhost named[4640]: client 172.16.100.200#57110: view telecom_lan: transfer of 'maomao.com/IN': AXFR ended
Feb 1 17:42:23 localhost named[4640]: client 172.16.100.201#59099: view unicom_lan: transfer of 'maomao.com/IN': AXFR started
Feb 1 17:42:23 localhost named[4640]: client 172.16.100.201#59099: view unicom_lan: transfer of 'maomao.com/IN': AXFR ended
Feb 1 17:42:23 localhost named[4640]: client 172.16.100.202#55040: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
Feb 1 17:43:22 localhost named[4640]: client 172.16.100.202#45582: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
Feb 1 17:45:18 localhost named[4640]: client 172.16.100.202#36774: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
Feb 1 17:48:54 localhost named[4640]: client 172.16.100.202#43266: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
Feb 1 17:55:07 localhost named[4640]: client 172.16.100.202#57428: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
Feb 1 18:08:56 localhost named[4640]: client 172.16.100.202#45258: view unicom_lan: zone transfer 'maomao.com/AXFR/IN' denied
[/code]


4, 下面是从DNS的log

[code]Feb 1 17:22:22 localhost named[8483]: running
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/telecom_lan: Transfer started.
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/telecom_lan' from 192.168.10.200#53: connected using 172.16.100.200#56560
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/telecom_lan: transferred serial 2016020100
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/telecom_lan' from 192.168.10.200#53: Transfer completed: 1 messages, 7 records, 194 bytes, 0.005 secs (38800 bytes/sec)
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/telecom_lan: sending notifies (serial 2016020100)
Feb 1 17:22:22 localhost named[8483]: client 172.16.100.200#10297: view unicom_lan: received notify for zone 'maomao.com'
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/unicom_lan: refused notify from non-master: 172.16.100.200#10297
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/other_lan: Transfer started.
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/unicom_lan: Transfer started.
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/other_lan' from 192.168.10.200#53: connected using 172.16.100.202#49239
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/unicom_lan' from 192.168.10.200#53: connected using 172.16.100.201#47583
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/other_lan' from 192.168.10.200#53: failed while receiving responses: REFUSED
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/other_lan' from 192.168.10.200#53: Transfer completed: 0 messages, 0 records, 0 bytes, 0.004 secs (0 bytes/sec)
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/unicom_lan: transferred serial 2016020100
Feb 1 17:22:22 localhost named[8483]: transfer of 'maomao.com/IN/unicom_lan' from 192.168.10.200#53: Transfer completed: 1 messages, 7 records, 194 bytes, 0.006 secs (32333 bytes/sec)
Feb 1 17:22:22 localhost named[8483]: zone maomao.com/IN/unicom_lan: sending notifies (serial 2016020100)
[/code]
文章评论

共有 2 条评论

  1. neil.lin 于 2017-04-14 15:29:13发表:

    不错不错

  2. love寂寞暴飞 于 2016-02-08 17:45:08发表:

    不错不错