Wednesday, December 19, 2012

Increase File Descriptor Limit For NAMED/BIND/DNS

BIND/NAMED is compiled with a hard limit of 4,096 file descriptors and sockets and as a result if you have alot of IP's on a server you may see the following errors in /var/log/messages.
socket: file descriptor exceeds limit (4096/4096)
could not listen on UDP socket: not enough free resource

To increase that limit, add the following:
ulimit -HSn 200000
OPTIONS="-4 -S 8096"
to:
/etc/sysconfig/named
and then run:
service named restart
Verify in /var/log/messages that you are no longer seeing those errors and also run:
service named status
...to ensure NAMED is running properly.