I have just installed Pi-hole on a Debian minimal server, along with Unbound DNS resolver. And I think it's working fine.
First I installed Unbound, using this nlnetlabs page, and then I followed this Pi-hole guide.
My questions are regarding /etc/unbound/unbound.conf and /etc/unbound/unbound.conf.d/pi-hole.conf .
(1) Are both of these config files, unbound.conf and pi-hole.conf, should be configured exactly same?
(2) I have added few things on my own in pi-hole.conf, that I found in this Unbound manpage, though commented out some of them, as I wasn't sure whether they should be there. Could someone knowledgeable comment on that please.
Many thanks in advance, any help is greatly appreciated. -Jags
my /etc/unbound/unbound.conf is:
server:
interface: 0.0.0.0
interface: ::0
access-control: 192.168.0.0/16 allow
access-control: ::1 allow
verbosity: 1
my /etc/unbound/unbound.conf.d/pi-hole.conf is:
server:
interface: 0.0.0.0
interface: ::0
access-control: 192.168.0.0/16 allow
access-control: ::1 allow
# access-control: 0.0.0.0/0 allow
# Ensure privacy of local IP ranges
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: 172.16.0.0/12
private-address: 10.0.0.0/8
private-address: fd00::/8
private-address: fe80::/10
# Minimum lifetime of cache entries in seconds. Default is 0.
cache-min-ttl: 60
# Maximum lifetime of cached entries. Default is 86400 seconds (1 day).
cache-max-ttl: 259200
port: 5353
do-ip4: yes
do-ip6: no
do-udp: yes
do-tcp: yes
do-daemonize: no
# default is to use syslog, which will log to /var/log/messages.
use-syslog: no
# to log elsewhere, set 'use-syslog' to 'no', and set the log file location below:
logfile: "/var/log/unbound/unbound.log"
log-time-ascii: yes
verbosity: 2
# This is set to 'no' above already. May be set to yes if you have IPv6 connectivity:
# do-ip6: no
# Use this only when you downloaded the list of primary root servers!
root-hints: "/var/lib/unbound/root.hints"
# Trust glue only if it is within the servers authority
harden-glue: yes
# Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS
harden-dnssec-stripped: yes
# enable to not answer id.server and hostname.bind queries.
hide-identity: yes
# enable to not answer version.server and version.bind queries.
hide-version: yes
# Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes
# see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
use-caps-for-id: no
# Reduce EDNS reassembly buffer size.
# Suggested by the unbound man page to reduce fragmentation reassembly problems
edns-buffer-size: 1472
# Perform prefetching of close to expired message cache entries
# This only applies to domains that have been frequently queried
prefetch: yes
# One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine it should be unnecessary to seek performance enhancement by increasing num-threads above 1.
num-threads: 2
# Ensure kernel buffer is large enough to not lose messages in traffic spikes
so-rcvbuf: 10m
val-clean-additional: yes
val-sig-skew-min: 3600
val-sig-skew-max: 86400
val-bogus-ttl: 60
val-log-level: 2
# python:
# remote-control:
# control-enable: no
# chroot: "/var/unbound"
# username: "unbound"
# directory: "/var/unbound"
# pidfile: "/var/run/unbound.pid"
# tcp-upstream: no
# cache-max-negative-ttl: 0
# neg-cache-size: 0
# unwanted-reply-threshold: 10000
# do-not-query-localhost: yes
# auto-trust-anchor-file: "root.key"
# log-queries: no
# log-replies: no