免费注册 查看新帖 |

Chinaunix

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

trouble with dns [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-17 15:37 |只看该作者 |倒序浏览
5可用积分
named.conf:
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // query-source address * port 53;
listen-on port 53 { 127.0.0.1;
                   192.168.0.2; };
};

# Use with the following in named.conf, adjusting the allow list as needed:
key "rndckey" {
       algorithm hmac-md5;
       secret "K0X1SybSt5YF+hwaoyK3Cg==";
};

controls {
       inet 127.0.0.1 port 953
               allow { 127.0.0.1; } keys { "rndckey"; };
};
# End of named.conf
  
zone "." IN {
        type hint;
        file "named.ca";
..............





rndc.conf:
# Start of rndc.conf
key "rndckey" {
        algorithm hmac-md5;
        secret "K0X1SybSt5YF+hwaoyK3Cg==";
};

options {
        default-key "rndckey";
        default-server 127.0.0.1;
        default-port 953;
};
# End of rndc.conf

# Use with the following in named.conf, adjusting the allow list as needed:
# key "rndckey" {
#       algorithm hmac-md5;
#       secret "K0X1SybSt5YF+hwaoyK3Cg==";
# };
#
# controls {
#       inet 127.0.0.1 port 953
#               allow { 127.0.0.1; } keys { "rndckey"; };
# };
# End of named.conf




error:
[root@localhost log]# rndc status
rndc: connect failed: connection refused



log:
Jun 17 05:21:31 localhost named[12581]: starting BIND 9.2.3 -u named -t /var/named/chroot
Jun 17 05:21:31 localhost named[12581]: using 1 CPU
Jun 17 05:21:31 localhost named[12581]: loading configuration from '/etc/named.conf'
Jun 17 05:21:31 localhost named[12581]: listening on IPv4 interface lo, 127.0.0.1#53
Jun 17 05:21:31 localhost named[12581]: listening on IPv4 interface eth0, 192.168.0.2#53
Jun 17 05:21:31 localhost named[12581]: couldn't add command channel 127.0.0.1#953: not found
Jun 17 05:21:31 localhost named[12581]: couldn't add command channel ::1#953: not found
Jun 17 05:21:31 localhost named[12581]: running
Jun 17 15:21:31 localhost named: named

论坛徽章:
0
2 [报告]
发表于 2007-06-17 15:52 |只看该作者
named.conf 里
使用C语言的风格注释
// 开头代表注释
/* 开头 至 */ 的部分也代表注释。

而楼主用#号注释,当然不行。

论坛徽章:
0
3 [报告]
发表于 2007-06-17 16:00 |只看该作者
好象还是不行, 我直接删除了那两行,都不行, 还是一样的错误.好象我看过说明 //和#都可以注释把.
...

论坛徽章:
0
4 [报告]
发表于 2007-06-17 16:04 |只看该作者
发现#也可以作注释行?
你是什么系统?什么版本的DNS服务器?

执行servevice named start
能启动么 ?

[ 本帖最后由 maluyao 于 2007-6-17 16:06 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2007-06-17 16:09 |只看该作者
系统fc 2的
bind 9-3-2好象是
启动是可以启动的,就是rndc不能启动

论坛徽章:
0
6 [报告]
发表于 2007-06-17 16:21 |只看该作者
把这段的注释打开看看

  1. # Use with the following in named.conf, adjusting the allow list as needed:
  2. # key "rndckey" {
  3. #       algorithm hmac-md5;
  4. #       secret "K0X1SybSt5YF+hwaoyK3Cg==";
  5. # };
  6. #
  7. # controls {
  8. #       inet 127.0.0.1 port 953
  9. #               allow { 127.0.0.1; } keys { "rndckey"; };
  10. # };
复制代码

论坛徽章:
0
7 [报告]
发表于 2007-06-17 16:24 |只看该作者
哪个是rndc.conf里面的把
我是用rndc-confgen>/etc/rndc.conf生成的, 应该不会错把
不过我先试一下

论坛徽章:
0
8 [报告]
发表于 2007-06-17 16:31 |只看该作者
[root@localhost root]# service named restart
停止 named:rndc: error: /etc/rndc.conf:20: unknown option 'controls'
rndc: could not load rndc configuration
                                                           [  确定  ]
启动 named:                                               [  确定  ]
[root@localhost root]# rndc status
rndc: error: /etc/rndc.conf:20: unknown option 'controls'
rndc: could not load rndc configuration

论坛徽章:
0
9 [报告]
发表于 2007-06-18 11:05 |只看该作者
去掉了#,还是不行,报的错误更多了

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
10 [报告]
发表于 2007-06-18 11:20 |只看该作者
rndc: error: /etc/rndc.conf:20: unknown option 'controls'

贴出该文件。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP