免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1255 | 回复: 0
打印 上一主题 下一主题

bind9.3配置疑 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-01-05 10:48 |只看该作者 |倒序浏览
实验环境:master ip:192.168.233.128
  slave ip:192.168.233.130
我对allow-notify这个参数的使用上有疑惑,在百度文库里找到相关资料说这个参数是与“notify yes;”结合使用的,且例子里是配置为如下:
options
{
notify yes;
allow-notify {从DNS地址};
};
但是这样配置后在从DNS重新启动服务时日志文件会报错,便于说得清楚点,我把主从DNS的配置文件贴出来。
master named.conf:
options {
  directory "/var/named";
  allow-query {any;};
  listen-on port 53 {any;};
  forwarders {61.128.128.68;61.192.128.68;};
  allow-recursion {192.168.233.0/24;};
  notify yes;
allow-notify {192.168.233.130;};

};
logging {
  category lame-servers {null;};
};
  zone "." {
  type hint;
  file "named.root";
  };
  zone "localhost" {
  type master;
  file "localhost.zone";
  };
  zone "0.0.127.in-addr.arpa"{
  type master;
  file "named.local";
  };
  zone "zhaochj.org" {
  type master;
  file "named.zhaochj.org";
  allow-transfer {192.168.233.130;};
  };
  zone "233.168.192.in-addr.arpa" {
  type master;
  file "named.192.168.233";
  allow-transfer {192.168.233.130;};
  };
key "rndckey" {
  algorithm hmac-md5;
  secret "v7WVnhnsZ/PmspO8Xesd+g==";
};
  
controls {
  inet 127.0.0.1 port 953
  allow { 127.0.0.1; } keys { "rndckey"; };
};

slave named.conf:
options {
  directory "/var/named";
  allow-query {any;};
  listen-on port 53 {any;};
  allow-recursion {192.168.233.0/24;};
  forwarders {61.128.128.68;61.192.128.68;};
};
logging {
  category lame-servers {null;};
};
  zone "." {
  type hint;
  file "named.root";
  };
  zone "localhost" {
  type master;
  file "localhost.zone";
  };
  zone "0.0.127.in-addr.arpa"{
  type master;
  file "named.local";
  };
  zone "zhaochj.org" {
  type slave;
  file "slaves/named.zhaochj.org";
  masters {192.168.233.128;};
  };
  zone "233.168.192.in-addr.arpa" {
  type slave;
  file "slaves/named.192.168.233";
  masters {192.168.233.128;};
  };
key "rndckey" {
  algorithm hmac-md5;
  secret "vEfapQb6CYHbCU8KoSv9BQ==";
};
  
controls {
  inet 127.0.0.1 port 953
  allow { 127.0.0.1; } keys { "rndckey"; };
};
如此配置后,分别重新启动主从DNS服务观察日志文件,在从DNS日志文件中是这样的:

[root@zcj ~]# tail -f /var/log/messages
Oct 20 02:25:29 zcj named[12215]: zone 233.168.192.in-addr.arpa/IN: loaded serial 1997022706
Oct 20 02:25:29 zcj named[12215]: zone localhost/IN: loaded serial 42
Oct 20 02:25:29 zcj named[12215]: zone zhaochj.org/IN: loaded serial 57
Oct 20 02:25:29 zcj named[12215]: running
Oct 20 02:25:29 zcj named[12215]: zone zhaochj.org/IN: sending notifies (serial 57)
Oct 20 02:25:29 zcj named[12215]: zone 233.168.192.in-addr.arpa/IN: sending notifies (serial 1997022706)
Oct 20 02:25:29 zcj named[12215]: client 192.168.233.130#29959: received notify for zone 'zhaochj.org'
Oct 20 02:25:29 zcj named[12215]: zone zhaochj.org/IN: refused notify from non-master: 192.168.233.130#29959
Oct 20 02:25:30 zcj named[12215]: client 192.168.233.130#27652: received notify for zone '233.168.192.in-addr.arpa'
Oct 20 02:25:30 zcj named[12215]: zone 233.168.192.in-addr.arpa/IN: refused notify from non-master: 192.168.233.130#27652
看见吧,有“refused notify from non-master”这样的错误信息,好像是说从master那里的通告被拒绝了!
然后我把主从DNS的配置文件进行如下更改后,日志文件里就没有问题了,但是这样的配置我自己都不能理解。
master named.conf,去掉了notify的参数:
options {
  directory "/var/named";
  allow-query {any;};
  listen-on port 53 {any;};
  forwarders {61.128.128.68;61.192.128.68;};
  allow-recursion {192.168.233.0/24;};
};
logging {
  category lame-servers {null;};
};
  zone "." {
  type hint;
  file "named.root";
  };
  zone "localhost" {
  type master;
  file "localhost.zone";
  };
  zone "0.0.127.in-addr.arpa"{
  type master;
  file "named.local";
  };
  zone "zhaochj.org" {
  type master;
  file "named.zhaochj.org";
  allow-transfer {192.168.233.130;};
  };
  zone "233.168.192.in-addr.arpa" {
  type master;
  file "named.192.168.233";
  allow-transfer {192.168.233.130;};
  };
key "rndckey" {
  algorithm hmac-md5;
  secret "v7WVnhnsZ/PmspO8Xesd+g==";
};
  
controls {
  inet 127.0.0.1 port 953
  allow { 127.0.0.1; } keys { "rndckey"; };
};
slave named.conf,加上notify的参数,且后边的Ip还是自己的ip:
options {
  directory "/var/named";
  allow-query {any;};
  listen-on port 53 {any;};
  allow-recursion {192.168.233.0/24;};
  forwarders {61.128.128.68;61.192.128.68;};
allow-notify {192.168.233.130;};
};
logging {
  category lame-servers {null;};
};
  zone "." {
  type hint;
  file "named.root";
  };
  zone "localhost" {
  type master;
  file "localhost.zone";
  };
  zone "0.0.127.in-addr.arpa"{
  type master;
  file "named.local";
  };
  zone "zhaochj.org" {
  type slave;
  file "slaves/named.zhaochj.org";
  masters {192.168.233.128;};
  };
  zone "233.168.192.in-addr.arpa" {
  type slave;
  file "slaves/named.192.168.233";
  masters {192.168.233.128;};
  };
key "rndckey" {
  algorithm hmac-md5;
  secret "vEfapQb6CYHbCU8KoSv9BQ==";
};
  
controls {
  inet 127.0.0.1 port 953
  allow { 127.0.0.1; } keys { "rndckey"; };
};
分别重新启动主从DNS的服务,再来看从DNS服务器的日志文件:
[root@zcj ~]# tail -f /var/log/messages
Oct 20 02:30:01 zcj named[12275]: zone 233.168.192.in-addr.arpa/IN: sending notifies (serial 1997022706)
Oct 20 02:30:01 zcj named[12275]: zone zhaochj.org/IN: sending notifies (serial 57)
Oct 20 02:30:01 zcj named[12275]: client 192.168.233.130#12459: received notify for zone '233.168.192.in-addr.arpa'
Oct 20 02:30:01 zcj named[12275]: zone 233.168.192.in-addr.arpa/IN: notify from 192.168.233.130#12459: zone is up to date
Oct 20 02:30:01 zcj named[12275]: client 192.168.233.130#3369: received notify for zone 'zhaochj.org'
Oct 20 02:30:01 zcj named[12275]: zone zhaochj.org/IN: notify from 192.168.233.130#3369: zone is up to date
Oct 20 02:30:07 zcj named[12275]: client 192.168.233.128#52554: received notify for zone 'zhaochj.org'
Oct 20 02:30:07 zcj named[12275]: zone zhaochj.org/IN: notify from 192.168.233.128#52554: zone is up to date
Oct 20 02:30:08 zcj named[12275]: client 192.168.233.128#40378: received notify for zone '233.168.192.in-addr.arpa'
Oct 20 02:30:08 zcj named[12275]: zone 233.168.192.in-addr.arpa/IN: notify from 192.168.233.128#40378: zone is up to date

看见吗?这样才是正常的,我就是没有弄明白了,这个notify参数到底要怎么用,怎么会配置在从dns的配置文件里,后边还是自己的ip地址,请各位解答的我疑惑,这事情困扰我好久了!谢谢!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP