Bind named service high cpu load [closed]
Asked Answered
G

2

7

named service under CentOs 6 is using more 100% of all 4 processors. I tried to play around with the configuration files. I currently have like 10 websites. below is a sample

$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

and for 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

i changed the ip and domains to make it a general question for everyone. Thing is i don't use mail or smtp at all, i might add MX records in the future and rely on gmail for example for emails. Is it safe to remove mail/pop/smtp/MX records?

Based on your experience what is causing this huge CPU load for several months!

Gourde answered 24/10, 2012 at 22:48 Comment(0)
B
5

I had the same issue, and the information in the link posted by Starcalc above worked for me (though the post he linked is for Ubuntu). This is what I did for my CentOS 6.4 box:

In /etc/named.conf, ensure you have the line present in the options{} section

managed-keys-directory "/var/named/dynamic";

Also, make sure you have the directories /var/named/dynamic and /var/named/chroot/var/named/dynamic presesent, ensure all are owned by named:named (easy way: chown -R named:named /var/named ) and if you run with SELinux, do: restorecon -R /var/named/

Buonaparte answered 19/8, 2013 at 8:20 Comment(1)
Thanks for the tip on adding dynamic within the chroot directory; wonder why this isn't done by default!Ramage
L
0

Check your /etc/named.conf file have managed-keys-directory "/var/named/dynamic"; in options scope.

Then check your bind files exist under both /var/named and /var/named/chroot/var/named directories.

Stop named service

#service stop named

Check or create files

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

chroot files

#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

Don't forget to change owner of files.

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

start named daemon

#service named start
Lymphadenitis answered 24/10, 2013 at 14:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.