# Named not working when system restarts



## runtomaker (Mar 25, 2018)

Hello, I'm using BIND 9.11.2-P1 with FreeBSD 11. Not working nameserver when system restarts. How to Fix ? There /etc/rc.conf in  `named_enable="yes"` value. Always when system restarting need manual command `service named restart` to work.

My named.conf:


```
options {
        directory       "/usr/local/etc/namedb/working";
        pid-file        "/var/run/named/pid";
        dump-file       "/var/dump/named_dump.db";
        statistics-file "/var/stats/named.stats";

        listen-on       { any; };
};

zone "example.com" {
        type master;
        allow-update {none;};
        file "/usr/local/etc/namedb/dynamic/example.com";
};
```


----------



## ralphbsz (Mar 25, 2018)

How do you know named is not working (after a restart)?  What are the exact symptoms?
What are the error messages?  Have you looked in the various log files in /var/log/...?
What is the content of your zone file for "example.com" ?
Why is your name.conf file so much shorter than the default that is provided with the package installation?  Even though a lot of the default is comments, it also contains many useful sections.


----------



## runtomaker (Mar 30, 2018)

Sir before sorry for late time.
I trying to work ping to nameservers and checking service status (already running).

Log file /var/log/messages:


```
Mar 30 13:04:10 bsd named[985]: running as: named -u bind -c /usr/local/etc/namedb/named.conf

Mar 30 13:04:10 bsd named[985]: ----------------------------------------------------

Mar 30 13:04:10 bsd named[985]: BIND 9 is maintained by Internet Systems Consortium,

Mar 30 13:04:10 bsd named[985]: Inc. (ISC), a non-profit 501(c)(3) public-benefit

Mar 30 13:04:10 bsd named[985]: corporation.  Support and training for BIND 9 are

Mar 30 13:04:10 bsd named[985]: available at https://www.isc.org/support

Mar 30 13:04:10 bsd named[985]: ----------------------------------------------------

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(21, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(22, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(23, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(24, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(25, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: command channel listening on 127.0.0.1#953

Mar 30 13:04:10 bsd named[985]: socket.c:5695: unexpected error:

Mar 30 13:04:10 bsd named[985]: setsockopt(26, TCP_FASTOPEN) failed with Protocol not available

Mar 30 13:04:10 bsd named[985]: command channel listening on ::1#953

Mar 30 13:04:10 bsd named[985]: all zones loaded

Mar 30 13:04:10 bsd named[985]: running
```


----------



## DutchDaemon (Mar 30, 2018)

Simple forums search: https://forums.freebsd.org/threads/tcp_fastopen.59367/


----------



## runtomaker (Mar 30, 2018)

Kernel recompiling long time.


DutchDaemon said:


> Simple forums search: https://forums.freebsd.org/threads/tcp_fastopen.59367/


I now trying to Kernel compiling from custom. I started 1 hour ago compiling now not completed in server. Do not have any other solution to compile kernel?


----------



## ShelLuser (Mar 30, 2018)

runtomaker said:


> I now trying to Kernel compiling from custom. I started 1 hour ago compiling now not completed in server. Do not have any other solution to compile kernel?


Of course. Use a generic kernel and apply the sysctl settings as mentioned in that thread which DutchDaemon posted.


----------

