From e6ddad614f9410391e3b8f73be0bf4b724c7aeb6 Mon Sep 17 00:00:00 2001 From: yubiuser Date: Wed, 26 Aug 2020 21:42:51 +0200 Subject: [PATCH] Add logging instructions to unbound guide (#354) * Add logging instructions to unbound guide * Remove leftovers * Remove copy&paste error * Fix markdownlint errors * Use --parent option with mkdir Signed-off-by: yubiuser Co-authored-by: Dan Schaper --- docs/guides/unbound.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) 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 +```