免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: mxbao
打印 上一主题 下一主题

trouble with dns [复制链接]

论坛徽章:
0
11 [报告]
发表于 2007-06-18 11:53 |只看该作者
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

之所以出那个问题,是因为maluyao 老大说把上面的#号去掉试试看,结果就报那个错误.
加上#,是没有那个错误的,只有前面的错误

论坛徽章:
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
12 [报告]
发表于 2007-06-18 15:38 |只看该作者
下边的那段是复制到named.conf中去的,不过你已经做了。
启动named后运行
netstat -na 看一下有没有953端口。先关掉防火墙。

论坛徽章:
0
13 [报告]
发表于 2007-06-18 16:50 |只看该作者
防火墙直接都关了的...我也查了一下午的原因,昨天...
我删了拷贝的,直接建立rndc.key文件,也一样,所以很晕
我都怀疑是不是bind程序装的有问题

论坛徽章:
0
14 [报告]
发表于 2007-06-18 17:06 |只看该作者
从你的提示来看,关闭Named服务时不正常。
你先使用/etc/init.d/named stop停掉,然后再用/etc/init.d/named start启动。RedHat的好几个bind发行版本存在这个问题。
我的配置配置与你的一样,完全没有问题。
named.conf的完整内容:

  1. options {
  2.         directory "/var/named";
  3.         /*
  4.          * If there is a firewall between you and nameservers you want
  5.          * to talk to, you might need to uncomment the query-source
  6.          * directive below.  Previous versions of BIND always asked
  7.          * questions using port 53, but BIND 8.1 uses an unprivileged
  8.          * port by default.
  9.          */
  10.         // query-source address * port 53;
  11. listen-on port 53 { 127.0.0.1;
  12.                    192.168.0.2; };
  13. };
  14. # Use with the following in named.conf, adjusting the allow list as needed:
  15. key "rndckey" {
  16.        algorithm hmac-md5;
  17.        secret "K0X1SybSt5YF+hwaoyK3Cg==";
  18. };
  19. controls {
  20.        inet 127.0.0.1 port 953
  21.                allow { 127.0.0.1; } keys { "rndckey"; };
  22. };
  23. include "/etc/named.rfc1912.zones";

复制代码

rndc.conf的完整内容:

  1. key "rndckey" {
  2.         algorithm hmac-md5;
  3.         secret "K0X1SybSt5YF+hwaoyK3Cg==";
  4. };
  5. options {
  6.         default-key "rndckey";
  7.         default-server 127.0.0.1;
  8.         default-port 953;
  9. };
复制代码


rndc status的输出:
  1. [root@server etc]# rndc status
  2. number of zones: 6
  3. debug level: 0
  4. xfers running: 0
  5. xfers deferred: 0
  6. soa queries in progress: 0
  7. query logging is OFF
  8. recursive clients: 0/1000
  9. tcp clients: 0/100
  10. server is up and running
复制代码

论坛徽章:
0
15 [报告]
发表于 2007-06-18 17:13 |只看该作者
看来真的是bind程序有问题,晕晕,我也觉得配置没有错误,检查过好多次了

论坛徽章:
0
16 [报告]
发表于 2007-06-19 00:28 |只看该作者
lz 的 kernel 版本是多少?2.4 的内核有一些版本是存在 rndc stop 无法停止 named 进程的情况,

升级 kernel 后就可以了。

btw :下面的 link 是一个完整的 troubleshooting 过程,lz 请参考

http://readlist.com/lists/isc.org/bind9-users/0/2032.html

论坛徽章:
0
17 [报告]
发表于 2007-06-19 10:23 |只看该作者
我的是2.4.x的把,没有注意,要升级到那些版本呢?

论坛徽章:
0
18 [报告]
发表于 2007-06-19 15:37 |只看该作者
楼主按我下面的做,你的太乱了


[root@dns1 etc]# ls -l /etc/named.conf
lrwxrwxrwx 1 root root 32 06-17 17:38 /etc/named.conf -> /var/named/chroot/etc/named.conf
[root@dns1 etc]#


[root@dns1 etc]# more /etc/named.conf
//
// named.conf for Red Hat caching-nameserver
//

options {
        directory "/var/named";
        dump-file "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        version "Unknow On This Platform";
        /*
         * 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;
};

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

acl "zone_transfer" {172.16.5.88;172.16.5.232;};

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


zone "person.com" IN {
        type master;
        file "person.com.dns";
        allow-transfer { zone_transfer; };
        allow-update { none; };
};

#zone "uis.edu.hk" IN {
#        type master;
#        file "uis.edu.hk.dns";
#       allow-transfer { zone_transfer; };
#        allow-update { none; };
#};

zone "5.16.172.in-addr.arpa" IN {
        type master;
        file "5.16.172.in-addr.arpa.dns";
        allow-transfer { zone_transfer; };
        allow-update { none; };
};

zone "localdomain" IN {
        type master;
        file "localdomain.zone";
        allow-update { none; };
};

zone "localhost" IN {
        type master;
        file "localhost.zone";
        allow-update { none; };
};

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

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 {
        type master;
        file "named.ip6.local";
        allow-update { none; };
};

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

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

logging {
        category lame-servers { null; };
};

include "/etc/rndc.key";



注意上面有 include "/etc/rndc.key"; 这一行


[root@dns1 etc]# ls -l /etc/rndc.key
lrwxrwxrwx 1 root named 31 06-17 16:46 /etc/rndc.key -> /var/named/chroot//etc/rndc.key

[root@dns1 etc]# more /etc/rndc.key
key "rndckey" {
        algorithm       hmac-md5;
        secret "G5N9cKYQikGFmDJTGbFKAeNbSiOoP5tq6z4FHjhVdU2NGV8ebbIpfC66iZu4";
};
[root@dns1 etc]#

注意你的/etc/rndc.key 是/var/named/chroot/etc/rndc.key 的符号链接

如下:
#ln -s  /var/named/chroot/etc/rndc.key   /etc/rndc.key

论坛徽章:
0
19 [报告]
发表于 2007-06-19 17:12 |只看该作者
没有用chroot
还有,直接把rndckey加载named.conf里面,是一样的,并不是设置有问题的

论坛徽章:
0
20 [报告]
发表于 2007-06-20 00:36 |只看该作者
我觉得是rndc.key的配置问题
仔细看了一下之前大家说的和LZ的日志,问题应该在这儿
现在netstat -an | grep 953应该没在监听
rndc.key里面的options那5行定义重复了,默认是存在的,需要删去
可以用命令检验一下,named-checkconf /etc/named.conf,应该会报rndc.key的这个错的
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP