# [SOLVED] BIND errors about max open files

## bombcar

On my server, I get:

```

Jan 24 21:28:16 mail named[9002]: loading configuration from '/etc/bind/named.conf'

Jan 24 21:28:16 mail named[9002]: max open files (1024) is smaller than max sockets (4096)

Jan 24 21:28:16 mail named[9002]: using default UDP/IPv4 port range: [1024, 65535]

Jan 24 21:28:16 mail named[9002]: using default UDP/IPv6 port range: [1024, 65535]

```

According to a Google search, this was common on 2.6.27 kernels, but I'm running 2.6.31-gentoo-r6. Any ideas on why I'm getting that max open files warning?Last edited by bombcar on Wed Feb 10, 2010 6:47 am; edited 1 time in total

----------

## doctork

I'm running bind-9.6.1_p2 on a X86_64 kernel 2.6.31-gentoo-r6.  When it starts, it tells me:

```
Jan 25 01:30:43 dwarf named[22495]: adjusted limit on open files from 1024 to 1048576

```

--

doc

----------

## bombcar

I found the solution:

This is caused by the default number of files that a process can run being set very low, to 1024. By default, in include/linux/fs.h:

#define INR_OPEN 1024           /* Initial setting for nfile rlimits */

You could edit that line and recompile your kernel, but that would involve doing that every time a new kernel was released. An easier option is to edit /etc/security/limits.conf, and add the line:

named        soft    nofile        4096

This sets the default limit for the named user to 4096. Note that you're have to stop and start the named daemon, and not simply run rndc reload, because it needs to actually exit for the changes to take effect. Now the warning will be gone!

----------

