I want to enable query logging permanently and I added these lines to end of my /etc/bind/named.conf.options
file
logging {
channel querylog {
file "/var/log/querylog";
severity debug 3;
};
};
and my file before adding logging section was as below and OK:
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
allow-transfer {none;};
allow-query {any;};
listen-on port 53 {localhost; MY_PUBLIC_IP;};
recursion no;
// forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
# listen-on-v6 { any; };
};
After adding logging section, when I restart my service with sudo systemctl restart named.service
, I get this error and the service won't start:
sudo journalctl -xeu named.service
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A stop job for unit named.service has finished.
░░
░░ The job identifier is 5419 and the job result is done.
Dec 07 04:03:07 NS1 systemd[1]: named.service: Start request repeated too quickly.
Dec 07 04:03:07 NS1 systemd[1]: named.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit named.service has entered the 'failed' state with result 'exit-code'.
Dec 07 04:03:07 NS1 systemd[1]: Failed to start BIND Domain Name Server.
░░ Subject: A start job for unit named.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit named.service has finished with a failure.
░░
░░ The job identifier is 5419 and the job result is failed.