日期:2011-01-23 03:26:00 来源:本站整理
<b>亲历:Linux平台下bind9弊端解除</b>[Linux安全]
本文“<b>亲历:Linux平台下bind9弊端解除</b>[Linux安全]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
笔者在公司的工作之一是负责保护公司的CDN,基本上是每天打bind打交道;在用源码安装完一台新的bind9.4后预备做主从复制时,诧异的发现竟然呈现了问题(主DNS是bind9.1):
这是在从DNS上呈现的问题一:
- Mar 26 16:04:17 gdst named[18464]: client
- 115.207.47.199#20601: view any: query (cache) '112.2.5.221.in-
- addr.arpa/PTR/IN' denied
- Mar 26 16:04:17 gdst named[18464]: client
- 115.207.47.199#20602: view any: query (cache)
- 'dx.3158.com.domain/A/IN' denied
- Mar 26 16:04:17 gdst named[18464]: client
- 115.207.47.199#20603: view any: query (cache)
- 'dx.3158.com.domain/AAAA/IN' denied
- Mar 26 16:04:17 gdst named[18464]: client
- 115.207.47.199#20604: view any: query (cache) 'y163.net/A/IN'
- denied
- Mar 26 16:04:17 gdst named[18464]: client
- 115.207.47.199#20605: view any: query (cache)
- 'y163.net/AAAA/IN' denied
- Mar 26 16:04:18 gdst named[18464]: client
- 115.207.47.199#20606: view any: query (cache) '112.2.5.221.in-
- addr.arpa/PTR/IN' denied
- Mar 26 16:04:18 gdst named[18464]: client
- 115.207.47.199#20607: view any: query (cache)
- 'dx.3158.com.domain/A/IN' denied
- Mar 26 16:04:18 gdst named[18464]: client
- 115.207.47.199#20608: view any: query (cache)
- 'dx.3158.com.domain/AAAA/IN' denied
- Mar 26 16:04:18 gdst named[18464]: client
- 115.207.47.199#20609: view any: query (cache) 'y163.net/A/IN'
- denied
- Mar 26 16:04:19 gdst named[18464]: client
- 115.207.47.199#20610: view any: query (cache)
- 'y163.net/AAAA/IN' denied
- Mar 26 16:04:19 gdst named[18464]: client
- 115.207.47.199#20611: view any: query (cache) '112.2.5.221.in-
- addr.arpa/PTR/IN' denied
- Mar 26 16:04:19 gdst named[18464]: client
- 115.207.47.199#20612: view any: query (cache)
- 'dx.3158.com.domain/A/IN' denied
- Mar 26 16:04:19 gdst named[18464]: client
- 115.207.47.199#20613: view any: query (cache)
- 'dx.3158.com.domain/AAAA/IN' denied
- Mar 26 16:04:19 gdst named[18464]: client
- 115.207.47.199#20614: view any: query (cache) 'y163.net/A/IN'
- denied
- Mar 26 16:04:20 gdst named[18464]: client
- 115.207.47.199#20615: view any: query (cache)
- 'y163.net/AAAA/IN' denied
- Mar 26 16:04:21 gdst named[18464]: client
- 60.215.129.103#53455: view any: query (cache)
- 'www.谷歌.com/A/IN' denied
- Mar 26 16:04:49 gdst named[18464]: client
- 121.14.128.68#53455: view CHINANET: query (cache)
- 'www.谷歌.com/A/IN' denied
- Mar 26 16:04:59 gdst named[18464]: client
- 221.171.1.147#53455: view CHINANET: query (cache)
- 'www.谷歌.com/A/IN' denied
发现新版的对cache的处理有所改变
新版本的BIND对 allow-query 有着差别的处理,新增添了一个allow-query-cache 的选项.
- QUOTE:allow-query Specifies which hosts are allowed to ask
- ordinary DNS questions. allow-query may also
- be specified in the zone statement, in which case it overrides the
- options allow-query statement.
- If not specified, the default is to allow queries from all hosts.
- QUOTE:allow-query-cache Specifies which hosts are allowed to
- get answers from the cache. The default is the
- builtin acls localnets and localhost.
- The way to set query access to the cache is now via allow-query-
- cache. This differs from earlier
- versions which used allow-query.
BIND 9.4 的手册上还分外注释了
QUOTE:allow-query-cache is now used to specify access to the
cache.
办理办法以下:即在从DNS的options里增添一条:
- key "rndc-key" {
- algorithm hmac-md5;
- secret "Rox3q+3f0gp8MKyQXx2zWw==";
- };
- controls {
- inet 127.0.0.1 port 953
- allow { localhost; } keys { "rndc-key"; };
- };
- options {
- version "9.8.12";
- directory "/var/named";
- pid-file "named.pid";
- allow-query { any; }; //此处为增添
- };
另一个关于主从复制的问题就是,假如bind采取了智能view功效的话,假如主DNS是电信的IP的话,从DNS非电信线路(即铁通或别的),假如均采取单IP是不能举行主从复制的,除非是双IP;假如只有单IP的话可采纳bind的TSIG key来办理此问题.在处理上述问题时,得到了linuxtone站长netseek帮忙,这里表示感激.
保护的DNS服务器主要有三个:一主一从一备,由于公司的架构采取了CDN筹划,所以namd.conf针对"okspace.com"的呈现位置就有三处:即电信、网通及别的,加上三个服务器,每次手动用vim删除okspace.com时就必须改正九处,保护起来很麻烦;更为不爽的是,有些zone常常需求删除,分外的麻烦,所以特地写了个shell以减清自己的负担,到达安全删除的目的.变量domain中的文件内容自己可以定义,签于生产环境下bind都是源码安装,这里就以named.conf文件为主.
- vim /root/delzone.sh
- #!/bin/bash
- domain='zone\ "okspace.cn"'
- if [ -e /var/named/chroot/etc/named.conf ];then
- sed -i "/$domain
以上是“<b>亲历:Linux平台下bind9弊端解除</b>[Linux安全]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
- <b>hosts是什么 hosts文件在什么位置 若何改正hosts</b>
- <b>在 Windows 8 中手动安装语言包</b>
- <b>五个常见 PHP数据库问题</b>
- Windows中Alt键的12个高效快速的利用本领介绍
- <b>MySQL ORDER BY 的实现解析</b>
- <b>详解MySQL存储历程参数有三种范例(in、out、inout)</b>
- <b>Win8系统恢复出来经典的开始菜单的办法</b>
- <b>Win8系统花屏怎么办 Win8系统花屏的办理办法</b>
- <b>Windows 7系统下无线网卡安装</b>
- <b>为什么 Linux不需求碎片整理</b>
- <b>Windows 8中删除账户的几种办法(图)</b>
- <b>教你如安在win7下配置路由器</b>
本文地址: | 与您的QQ/BBS好友分享! |
评论内容只代表网友观点,与本站立场无关!
评论摘要(共 0 条,得分 0 分,平均 0 分)
查看完整评论