免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 3834 | 回复: 19

[DNS] 智能DNS主辅同步不及时问题。 [复制链接]

论坛徽章:
0
发表于 2012-08-01 14:43 |显示全部楼层
本帖最后由 vangvanfei 于 2012-08-02 08:40 编辑

大侠们,帮忙看看智能dns 主辅同步问题,修改区域文件后,改大了serial 值后,重启主dns服务,电信view可以立刻同步,但是联通view 就要等一二十分钟后才能同步,想知道什么原因。
主dns的IP地址是192.168.1.8 ,辅助dns的IP地址是192.168.1.18和192.168.1.28。

主dns的named.conf配置文件如下
# cat ../../etc/named.conf
// Default named.conf generated by install of bind-9.2.4-16.EL4
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

include "cnc_acl.conf";

view "view_cnc" {
match-clients { CNC; };

zone "." IN {
        type hint;
        file "named.ca";
};

zone "xxx.com" IN {
        type master;
        file "xxx.com.zone.cnc";
        allow-transfer { 192.168.1.18; };
        also-notify { 192.168.1.18; };
};
};

view "view_any" {
match-clients { any; };

zone "." IN {
        type hint;
        file "named.ca";
};

zone "xxx.com" IN {
        type master;
        file "xxx.com.zone.telecom";
        allow-transfer { 192.168.1.28; };
        also-notify { 192.168.1.28; };
};
};


include "/etc/rndc.key";

------------------------------------------------------------------
cnc_acl.conf 列表中包含着 192.168.1.18
# cat cnc_acl.conf |more
acl "CNC" {
192.168.1.18;
1.24.0.0/13;
1.56.0.0/13;
..........
---------------------------------------------------------------
区域文件配置如下
$TTL    43200
xxx.com.              IN SOA  ns2.xxx.com. root (
                                        47              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
xxx.com.              IN NS           ns1.xxx.com.
xxx.com.              IN NS           ns2.xxx.com.
.............
--------------------------------------------------------------------
辅助dns的named.conf配置如下

// Default named.conf generated by install of bind-9.2.4-16.EL4
options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
        inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};

include "cnc_acl.conf";

view "view_cnc" {
match-clients { CNC; };

zone "." IN {
        type hint;
        file "named.ca";
};

zone "xxx.com" IN {
        type slave;
        file "slaves/xxx.com.zone.cnc";
        masters { 192.168.1.8; };
        transfer-source 192.168.1.18;
};
};

view "view_any" {
match-clients { any; };

zone "." IN {
        type hint;
        file "named.ca";
};

zone "xxx.com" IN {
        type slave;
        file "slaves/xxx.com.zone.telecom";
        masters { 192.168.1.8; };
        transfer-source 192.168.1.28;
};
};
include "/etc/rndc.key";
------------------------------------------------------------
日志没有报错信息,就是联通的view同步要比电信的晚上一二十分钟。是我配置有问题么?

论坛徽章:
0
发表于 2012-08-01 14:45 |显示全部楼层
  自己先顶一个,求大侠解决!。。。

论坛徽章:
0
发表于 2012-08-02 09:42 |显示全部楼层
view情况下的同步与普通情况下的同步是不同的,配合TSIG实现VIEW同步方式比较好。相关资料可以GOOGLE:

http://www.google.com.hk/search? ... .0.0..0.Dr7b3_xKHkY

有什么问题再发上来大家讨论。

论坛徽章:
0
发表于 2012-08-02 10:14 |显示全部楼层
回复 3# llzqq


    谢谢你的解答,我也仔细看过了你发的链接,配置和我的配置好像没什么区别,但是他们没有提到过只有一个view能及时同步,另一个view要很长时间同步的问题,难道只能使用 TSIG做主从同步?

论坛徽章:
0
发表于 2012-08-02 11:30 |显示全部楼层
这个有个适应的过程!同步也不能马上同步

论坛徽章:
0
发表于 2012-08-02 12:34 |显示全部楼层
回复 5# lchc008


    不会吧,因为我设置了also-notify ,区域文件有变动的,立即通知,所以应该是立即同步的,而且如果说同步有过程的话,为什么只有联通的view不能立即同步,电信的view就可以立即同步呢?

论坛徽章:
0
发表于 2012-08-02 17:02 |显示全部楼层
如果配置无误,正常情况下10秒内都应该同步,我的DNS有五个VIEW同步基本上是1-5秒。

论坛徽章:
0
发表于 2012-08-03 08:50 |显示全部楼层
回复 7# llzqq


正常情况下,确实是很快就同步了,像我的这个电信view,也就是1-5秒左右就更新,但是网通的view就是不行,要等很长一段时间。大侠,能帮我看下,上面我贴出的配置有问题么?

论坛徽章:
0
发表于 2012-08-03 10:06 |显示全部楼层
日志也没有什么报错信息,但是就是网通的view同步比电信view同步晚了8分40秒,大侠们,有人遇到过没有,帮忙看看什么问题。
下面是更改xxx.com区域文件,修改了serial值后的日志,
主dns的日志如下
Aug  3 09:27:38 localhost named[6934]: running
Aug  3 09:27:38 localhost named[6934]: zone xxx.com/IN/view_cnc: sending notifies (serial 46)
Aug  3 09:27:38 localhost named[6934]: zone xxx.com/IN/view_any: sending notifies (serial 46)
Aug  3 09:27:38 localhost named[6934]: client 192.168.1.28#46110: view view_any: transfer of 'xxx.com/IN': AXFR-style IXFR started
Aug  3 09:27:38 localhost named[6934]: client 192.168.1.28#46110: view view_any: transfer of 'xxx.com/IN': AXFR-style IXFR ended
Aug  3 09:36:18 localhost named[6934]: client 192.168.1.18#42805: view view_cnc: transfer of 'xxx.com/IN': AXFR-style IXFR started
Aug  3 09:36:18 localhost named[6934]: client 192.168.1.18#42805: view view_cnc: transfer of 'xxx.com/IN': AXFR-style IXFR ended
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
辅助dns上的日志如下
Aug  3 09:27:38 localhost named[28666]: client 192.168.1.8#18533: view view_any: received notify for zone 'xxx.com'
Aug  3 09:27:38 localhost named[28666]: zone xxx.com/IN/view_any: Transfer started.
Aug  3 09:27:38 localhost named[28666]: transfer of 'xxx.com/IN' from 192.168.1.8#53: connected using 192.168.1.28#46110
Aug  3 09:27:38 localhost named[28666]: zone xxx.com/IN/view_any: transferred serial 46
Aug  3 09:27:38 localhost named[28666]: transfer of 'xxx.com/IN' from 192.168.1.8#53: end of transfer
Aug  3 09:27:38 localhost named[28666]: zone xxx.com/IN/view_any: sending notifies (serial 46)
Aug  3 09:27:38 localhost named[28666]: client 192.168.1.8#36693: view view_any: received notify for zone 'xxx.com'
Aug  3 09:27:38 localhost named[28666]: zone xxx.com/IN/view_any: notify from 192.168.1.8#36693: zone is up to date
Aug  3 09:36:18 localhost named[28666]: zone xxx.com/IN/view_cnc: Transfer started.
Aug  3 09:36:18 localhost named[28666]: transfer of 'xxx.com/IN' from 192.168.1.8#53: connected using 192.168.1.18#42805
Aug  3 09:36:18 localhost named[28666]: zone xxx.com/IN/view_cnc: transferred serial 46
Aug  3 09:36:18 localhost named[28666]: transfer of 'xxx.com/IN' from 192.168.1.8#53: end of transfer
Aug  3 09:36:18 localhost named[28666]: zone xxx.com/IN/view_cnc: sending notifies (serial 46)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
没有任何报错信息!

论坛徽章:
0
发表于 2012-08-03 10:42 |显示全部楼层
每次修改过serial number  ?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP