绑定命名服务高CPU负载

时间:2012-10-24 22:48:39

标签: bind cpu-usage named nameservers abuse

CentOs 6下的命名服务使用了所有4个处理器中的100%。我试着玩配置文件。我目前有10个网站。下面是一个样本

$TTL 14400
@       IN      SOA     ns1.mynameserver.com.      hostmaster.mydomain.com. (
                                                2012071300
                                                14400
                                                3600
                                                1209600
                                                86400 )

mydomain.com.   14400   IN  NS  ns1.mynameserver.com.
mydomain.com.   14400   IN  NS  ns2.mynameserver.com.

ftp 14400   IN  A   123.218.168.8
localhost   14400   IN  A   127.0.0.1
mail    14400   IN  A   123.218.168.8
pop 14400   IN  A   123.218.168.8
mydomain.com.   14400   IN  A   123.218.168.8
smtp    14400   IN  A   123.218.168.8
www 14400   IN  A   123.218.168.8

mydomain.com.   14400   IN  MX  10 mail
mydomain.com.   14400   IN  TXT "v=spf1 a mx ip4:123.218.168.8 ~all"

localhost   14400   IN  AAAA    ::1

和mynameserver.com

$TTL 14400
@       IN      SOA     ns1.mynameserver.com.      hostmaster.mynameserver.com. (
                                                2012081200
                                                14400
                                                3600
                                                1209600
                                                86400 )

mynameserver.com.   14400   IN  NS  ns1.mynameserver.com.
mynameserver.com.   14400   IN  NS  ns2.mynameserver.com.

ftp 14400   IN  A   123.218.168.11
localhost   14400   IN  A   127.0.0.1
mail    14400   IN  A   123.218.168.11
ns1.mynameserver.com.   14400   IN  A   123.218.168.10
ns1.mynameserver.com.   14400   IN  A   123.218.168.11
ns2.mynameserver.com.   14400   IN  A   123.218.168.11
ns2.mynameserver.com.   14400   IN  A   123.218.168.11
pop 14400   IN  A   123.218.168.11
s1  14400   IN  A   123.218.168.11
smtp    14400   IN  A   123.218.168.11
mynameserver.com.   14400   IN  A   123.218.168.11
www 14400   IN  A   123.218.168.11
mynameserver.com.   14400   IN  MX  10 mail
mynameserver.com.   14400   IN  TXT "v=spf1 a mx ip4:123.218.168.8 ~all"
localhost   14400   IN  AAAA    ::1

我改变了ip和域名,使其成为每个人的一般性问题。事情是我根本不使用邮件或smtp,我可能会在将来添加MX记录,并依赖gmail例如电子邮件。删除邮件/ pop / smtp / MX记录是否安全?

根据您的经验,几个月内造成巨大CPU负载的原因是什么!

3 个答案:

答案 0 :(得分:5)

我遇到了同样的问题,Starcalc上面发布的链接中的信息对我有用(虽然他链接的帖子是Ubuntu)。这就是我为CentOS 6.4盒子做的事情:

在/etc/named.conf中,确保您在选项{}部分

中显示该行
managed-keys-directory "/var/named/dynamic";

另外,确保你有目录/ var / named / dynamic和/ var / named / chroot / var / named / dynamic presesent,确保所有目录都由named:named(简单方法:chown -R named:named) / var / named)如果你使用SELinux运行,请执行:restorecon -R / var / named /

答案 1 :(得分:2)

通常已知错误,请尝试在配置中添加另一行并添加目录,请参阅链接。

https://bugzilla.redhat.com/show_bug.cgi?id=709205#c29

答案 2 :(得分:0)

检查/etc/named.conf文件在选项范围内是否有 managed-keys-directory“/ var / named / dynamic”;

然后检查/ var / named和/ var / named / chroot / var / named目录下是否存在绑定文件。

停止命名服务

#service stop named

检查或创建文件

#mkdir /var/named/data
#touch /var/named/data/named.run
#mkdir /var/named/dynamic
#touch/var/named/dynamic/managed-keys.bind

chroot文件

#mkdir /var/named/chroot/data
#touch /var/named/chroot/data/named.run
#mkdir/var/named/chroot/var/named/dynamic
#touch /var/named/chroot/var/named/dynamic/managed-keys.bind

不要忘记更改文件的所有者。

#chown root:named -R /var/named/chroot/var/named/d*

启动named daemon

#service named start