免费注册 查看新帖 |

Chinaunix

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

[DNS] BIND安装之后rndc远程管理无法通信 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-08-07 01:48 |只看该作者 |倒序浏览
rndc.conf 里的字符串 KEY 与 rndc.key 内的一致。 也与远程服务器上的named.conf 里的一致。

防火墙已经开放了 953:TCP

环境两台PC服务器,内网IP分别是 192.168.1.170 , 192.168.1.169
170 和 169 都装有bind . 希望使用170上的 rndc 管理 169上的BIND。
170管理自己本机的没问题。


下面是 170 的 rndc.conf  和  169的 named.conf
  1. # 192.168.1.170  /etc/rndc.conf
  2. key "rndckey" {
  3.   algorithm hmac-md5;
  4.   secret "hicYxUdVMusnLMXOtxaOFAJ3lti7AP5owkraSo1R6fegMNF0JDdfx6KK3NzG";
  5. };


  6. key "192-168-1-170" {
  7.         algorithm hmac-md5;
  8.         secret "RFofx10uP15XfechRjB5ASuEwPH0cyX9lbv9VXDeNYM1RDolOeusDTsmdLG1";
  9. };

  10. server 192.168.1.169 {
  11.         key "192-168-1-170";
  12. };

  13. options {
  14.   default-key "rndckey";
  15.   default-server 127.0.0.1;
  16.   default-port 953;
  17. };
复制代码
  1. # 192.168.1.169 /var/named/chroot/etc/named.conf

  2. options {
  3.         directory "/var/named";
  4.         pid-file "/var/run/named.pid";
  5.         dump-file "/var/named/data/cache_dump.db";
  6.         statistics-file "/var/named/data/named_stats.txt";
  7.         recursion no;
  8.          // query-source address * port 53;
  9.         allow-query {any;};

  10. };


  11. controls {
  12.         inet 127.0.0.1 port 953
  13.                 allow {127.0.0.1;} keys {"rndckey";};
  14.         inet 192.168.1.169  port 953
  15.                 allow { 192.168.1.170; } keys { "192-168-1-170"; };

  16. };


  17. zone "." IN {
  18.         type hint;
  19.         file "named.ca";
  20. };

  21. zone "localdomain" IN {
  22.         type master;
  23.         file "localdomain.zone";
  24.         allow-update { none; };
  25. };

  26. zone "localhost" IN {
  27.         type master;
  28.         file "localhost.zone";
  29.         allow-update { 127.0.0.1 ; };
  30. };

  31. zone "0.0.127.in-addr.arpa" IN {
  32.         type master;
  33.         file "named.local";
  34.         allow-update { none; };
  35. };

  36. zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {
  37.         type master;
  38.         file "named.ip6.local";
  39.         allow-update { none; };
  40. };

  41. zone "255.in-addr.arpa" IN {
  42.         type master;
  43.         file "named.broadcast";
  44.         allow-update { none; };
  45. };

  46. zone "0.in-addr.arpa" IN {
  47.         type master;
  48.         file "named.zero";
  49.         allow-update { none; };
  50. };

  51. key "rndckey" {
  52.         algorithm       hmac-md5;
  53.         secret          "RFofx10uP15XfechRjB5ASuEwPH0cyX9lbv9VXDeNYM1RDolOeusDTsmdLG1";
  54. };
  55. key "192-168-1-170" {
  56.         algorithm       hmac-md5;
  57.         secret          "RFofx10uP15XfechRjB5ASuEwPH0cyX9lbv9VXDeNYM1RDolOeusDTsmdLG1";
  58. };
复制代码
连接无法通信。


[root@test003 etc]# rndc -s 192.168.1.169  -V status
create memory context
create socket manager
create task manager
create task
create logging context
setting log tag
creating log channel
enabling log channel
create parser
get key for server
get config key list
decode base64 secret
status
post event
using server 192.168.1.169 (192.168.1.169#953)
create socket
connect
create message
render message
schedule recv
send message
rndc: connection to remote host closed
This may indicate that the remote server is using an older version of
the command protocol, this host is not authorized to connect,
or the key is invalid.

希望高能能指点一下。感谢。

论坛徽章:
0
2 [报告]
发表于 2012-08-07 07:15 |只看该作者
本帖最后由 llzqq 于 2012-08-07 07:21 编辑

注意一下两台服务器的时钟是否一致。

另外确认一下169上的TCP:953是否监听在192.168.1.169上(netstat -an)

论坛徽章:
0
3 [报告]
发表于 2012-08-07 11:11 |只看该作者
回复 2# llzqq


    问题解决, 确实是两台服务器的时钟不一致导致的。 感谢 llzqq 。

    还有个问题,key的ID 在 rndc.conf 和 named.conf 是否也要一致 ?

下面红色部分:
key "my170" {
        algorithm hmac-md5;
        secret "RFofx10uP15XfechRjB5ASuEwPH0cyX9lbv9VXDeNYM1RDolOeusDTsmdLG1";
};

多台服务器用一个rndc 可不可以直接用参数载入 key文件的方式连接。 我试了几次都没成功
例如:
rndc-s 192.168.1.169 -k /etc/192-168-1-169.key -y 192-168-1-170 -V status
当我注销掉rndc.conf对应的项目采用文件时就失败了。

论坛徽章:
0
4 [报告]
发表于 2012-08-08 10:04 |只看该作者
KEY的名字要一致。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP