diff --git a/docs/guides/unbound.md b/docs/guides/unbound.md index 2896c32..dab40c1 100644 --- a/docs/guides/unbound.md +++ b/docs/guides/unbound.md @@ -157,3 +157,43 @@ Finally, configure Pi-hole to use your recursive DNS server by specifying `127.0 ![Upstream DNS Servers Configuration](../images/RecursiveResolver.png) (don't forget to hit Return or click on `Save`) + +### Add logging to unbound + +!!! warning + It's not recommonded to increase verbosity for daily use, as unbound logs a lot. But it might be helpful for debugging purposes. + +There are five levels of verbosity + +``` +Level 0 means no verbosity, only errors +Level 1 gives operational information +Level 2 gives detailed operational information +Level 3 gives query level information +Level 4 gives algorithm level information +Level 5 logs client identification for cache misses +``` + +First, specify the log file and the verbosity level in the `server` part of +`/etc/unbound/unbound.conf.d/pi-hole.conf`: + +```ini +server: + # If no logfile is specified, syslog is used + logfile: "/var/log/unbound/unbound.log" + verbosity: 1 +``` + +Second, create log dir and file, set permissions: + +``` +sudo mkdir -p /var/log/unbound +sudo touch /var/log/unbound/unbound.log +sudo chown unbound /var/log/unbound/unbound.log +``` + +Third, restart unbound: + +``` +sudo service unbound restart +```