You get a bonus - 1 coin for daily activity. Now you have 1 coin

How to Enable Logging on the Bind (Named) DNS Server on Debian

Practice



Following most guides for installing the Bind (Named) DNS server (even if you install it intuitively just through apt-get with subsequent configuration), the DNS server does not write any logs anywhere. But that's not right, is it? I mean, as long as everything works - fine, but as soon as you need to trace errors - that's where we're stuck.

Let's allow the OS to keep logs for the DNS server.


Solution

By default, Bind sends its logs to syslog, or more precisely - rsyslog. Which, by default, doesn't expect anything from it and therefore ignores it.

To enable logging, you need to edit the file /etc/rsyslog.conf and add the following block to the end:

/etc/rsyslog.conf:
!named
*.* /var/log/named.log
!-named

After that, restart rsyslog:
$ sudo /etc/init.d/rsyslog restart


And now the logs will appear in /var/log/named.log

Applies to: Debian + Bind

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)