手机版
你好,游客 登录 注册
背景:
阅读新闻

一次关于DNS服务器的故障排错记录——RNDC故障

[日期:2012-03-30] 来源:Linux社区  作者:dgd2010 [字体:大 中 小]

显然,最后的注释说的很清楚,要想使用rndc就必须在/etc/named.conf中进行配置。

所以将显示如下的/etc/named.conf第一段代码更改为第二段代码。

第一段代码:

  1. [root@localhost ~]# cat /etc/named.conf 
  2. // 
  3. // named.conf 
  4. // 
  5. // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS 
  6. // server as a caching only nameserver (as a localhost DNS resolver only). 
  7. // 
  8. // See /usr/share/doc/bind*/sample/ for example named configuration files. 
  9. // 
  10.  
  11. options { 
  12.     listen-on port 53 { 127.0.0.1; }; 
  13.     listen-on-v6 port 53 { ::1; }; 
  14.     directory   "/var/named"; 
  15.     dump-file   "/var/named/data/cache_dump.db"; 
  16.         statistics-file "/var/named/data/named_stats.txt"; 
  17.         memstatistics-file "/var/named/data/named_mem_stats.txt"; 
  18.     allow-query     { localhost; }; 
  19.     recursion yes; 
  20.  
  21.     dnssec-enable yes; 
  22.     dnssec-validation yes; 
  23.     dnssec-lookaside auto; 
  24.  
  25.     /* Path to ISC DLV key */ 
  26.     bindkeys-file "/etc/named.iscdlv.key"; 
  27. }; 
  28.  
  29. logging { 
  30.         channel default_debug { 
  31.                 file "data/named.run"; 
  32.                 severity dynamic; 
  33.         }; 
  34. }; 
  35.  
  36. zone "." IN { 
  37.     type hint; 
  38.     file "named.ca"; 
  39. }; 
  40.  
  41. include "/etc/named.rfc1912.zones"; 

第二段代码:

  1. [root@localhost ~]# cat /etc/named.conf 
  2. // 
  3. // named.conf 
  4. // 
  5. // Provided by Red Hat bind package to configure the ISC BIND named(8) DNS 
  6. // server as a caching only nameserver (as a localhost DNS resolver only). 
  7. // 
  8. // See /usr/share/doc/bind*/sample/ for example named configuration files. 
  9. // 
  10.  
  11. options { 
  12.     listen-on port 53 { 127.0.0.1; }; 
  13.     listen-on-v6 port 53 { ::1; }; 
  14.     directory   "/var/named"; 
  15.     dump-file   "/var/named/data/cache_dump.db"; 
  16.         statistics-file "/var/named/data/named_stats.txt"; 
  17.         memstatistics-file "/var/named/data/named_mem_stats.txt"; 
  18.     allow-query     { localhost; }; 
  19.     recursion yes; 
  20.  
  21.     dnssec-enable yes; 
  22.     dnssec-validation yes; 
  23.     dnssec-lookaside auto; 
  24.  
  25.     /* Path to ISC DLV key */ 
  26.     bindkeys-file "/etc/named.iscdlv.key"; 
  27. }; 
  28.  
  29. logging { 
  30.         channel default_debug { 
  31.                 file "data/named.run"; 
  32.                 severity dynamic; 
  33.         }; 
  34. }; 
  35.  
  36. zone "." IN { 
  37.     type hint; 
  38.     file "named.ca"; 
  39. }; 
  40.  
  41. include "/etc/named.rfc1912.zones"; 
  42. # Add line to enable named working with "/etc/rndc.conf" 
  43.  
  44. # Use with the following in named.conf, adjusting the allow list as needed: 
  45. key "rndc-key" { 
  46.        algorithm hmac-md5; 
  47.        secret "cK1Bt77B8kL9uLpxy4GDTg=="; 
  48. }; 
  49.  
  50. controls { 
  51.       inet 127.0.0.1 port 953 
  52.               allow { 127.0.0.1; } keys { "rndc-key"; }; 
  53. }; 
  54. # End of named.conf 
  55.  
  56. [root@localhost ~]#  

最后,重新启动named守护进程

  1. su - 
  2. service named restart 
  3. service named status 

结果显示如下,就表示可以了。

  1. [root@localhost ~]# service named status 
  2. version: 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 
  3. CPUs found: 2 
  4. worker threads: 2 
  5. number of zones: 19 
  6. debug level: 0 
  7. xfers running: 0 
  8. xfers deferred: 0 
  9. soa queries in progress: 0 
  10. query logging is OFF 
  11. recursive clients: 0/0/1000 
  12. tcp clients: 0/100 
  13. server is up and running 
  14. named (pid  11918) is running... 
  15. [root@localhost ~]#  

最后总结:

        其实问题的出现不一定就是存在硬错误,还可能存在软错误。就像C编程一样,有的语法错误,编译器或语法检查器能帮你识别并找出错误,但是在算法上的逻辑错误只能由编程人员自己发现和纠正。在配置Linux网络服务器时同样也可能遇到这类问题,只要管理员仔细查看问题,检查日志就很快发现问题的所在。希望在今后的工作中能更多的总结和发现、解决问题的思路,大胆的却有根据的自己去发现和解决问题。

linux
相关资讯       DNS服务器 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款