BIND: Max open files (1024) is smaller than max sockets (4096) Error and Solution

BIND: Max open files (1024) is smaller than max sockets (4096) Error and Solution

If you are running the BIND DNS server and you see an error message that says "max open files (1024) is smaller than max sockets (4096)," it means that the maximum number of file descriptors that BIND is allowed to use is smaller than the maximum number of sockets that it is allowed to use.

This error can occur if the value of the "ulimit -n" parameter is set too low on your system. "ulimit -n" is the maximum number of file descriptors that a process is allowed to have open at any given time.

To fix this error, you will need to increase the value of "ulimit -n" to a value that is larger than the value of the "max sockets" parameter in the BIND configuration file.

Here's how to do this:

  1. Edit the BIND configuration file, which is typically located at /etc/bind/named.conf.

  2. Locate the "max sockets" parameter and make note of its value.

  3. Open a terminal window and run the following command:

ulimit -n <new_value>
Sourc‮w:e‬ww.lautturi.com

Replace <new_value> with a value that is larger than the value of the "max sockets" parameter in the BIND configuration file.

  1. Restart the BIND service to apply the changes:
systemctl restart bind9

This should fix the error and allow BIND to run correctly.

Keep in mind that the value of "ulimit -n" may be reset to the default value when the system reboots. To make the change permanent, you will need to add the "ulimit -n" command to the startup script for BIND, or to a global startup script such as /etc/rc.local.

Created Time:2017-10-27 14:56:34  Author:lautturi