Unbound 1.9.6 available

Okay, so it's time for what it told you... What do the commands

sudo service unbound restart
sudo systemctl status unbound.service
sudo journalctl -xe

reveal?

sorry,

i tried everything...

sudo service unbound restart

Last login: Sat Jan 18 16:47:18 2020 from 192.168.178.25
ben2@raspberrypi:~ $ sudo service unbound restart
[sudo] password for ben2:
Job for unbound.service failed because the control process exited with error code.
See "systemctl status unbound.service" and "journalctl -xe" for details.

sudo systemctl status unbound.service

ben2@raspberrypi:~ $ sudo systemctl status unbound.service
● unbound.service - Unbound DNS server
   Loaded: loaded (/lib/systemd/system/unbound.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2020-01-18 16:55:03 GMT; 1min 47s ago
     Docs: man:unbound(8)
  Process: 3805 ExecStartPre=/usr/lib/unbound/package-helper chroot_setup (code=exited, status=0/SUCCESS)
  Process: 3815 ExecStartPre=/usr/lib/unbound/package-helper root_trust_anchor_update (code=exited, status=0/SUCCESS)
  Process: 3820 ExecStart=/usr/sbin/unbound -d $DAEMON_OPTS (code=exited, status=1/FAILURE)
 Main PID: 3820 (code=exited, status=1/FAILURE)

Jan 18 16:55:03 raspberrypi systemd[1]: unbound.service: Service RestartSec=100ms expired, scheduling restart.
Jan 18 16:55:03 raspberrypi systemd[1]: unbound.service: Scheduled restart job, restart counter is at 5.
Jan 18 16:55:03 raspberrypi systemd[1]: Stopped Unbound DNS server.
Jan 18 16:55:03 raspberrypi systemd[1]: unbound.service: Start request repeated too quickly.
Jan 18 16:55:03 raspberrypi systemd[1]: unbound.service: Failed with result 'exit-code'.
Jan 18 16:55:03 raspberrypi systemd[1]: Failed to start Unbound DNS server.
ben2@raspberrypi:~ $


sudo journalctl -xe

ben2@raspberrypi:~ $ sudo journalctl -xe
-- The unit unbound-resolvconf.service has entered the 'failed' state with result 'start-limit-hit'.
Jan 18 16:55:03 raspberrypi systemd[1]: Failed to start Unbound DNS server via resolvconf.
-- Subject: A start job for unit unbound-resolvconf.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit unbound-resolvconf.service has finished with a failure.
--
-- The job identifier is 5587 and the job result is failed.
Jan 18 16:56:50 raspberrypi sudo[3870]:     ben2 : TTY=pts/0 ; PWD=/home/ben2 ; USER=root ; COMMAND=/bin/systemctl status unbound.service
Jan 18 16:56:50 raspberrypi sudo[3870]: pam_unix(sudo:session): session opened for user root by ben2(uid=0)
Jan 18 16:56:50 raspberrypi sudo[3870]: pam_unix(sudo:session): session closed for user root
Jan 18 16:57:36 raspberrypi sudo[3889]:     ben2 : TTY=pts/0 ; PWD=/home/ben2 ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 18 16:57:36 raspberrypi sudo[3889]: pam_unix(sudo:session): session opened for user root by ben2(uid=0)
Jan 18 16:57:45 raspberrypi rngd[343]: stats: bits received from HRNG source: 140064
Jan 18 16:57:45 raspberrypi rngd[343]: stats: bits sent to kernel pool: 94848
Jan 18 16:57:45 raspberrypi rngd[343]: stats: entropy added to kernel pool: 94848
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2 successes: 7
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2 failures: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2(2001-10-10) Monobit: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2(2001-10-10) Poker: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2(2001-10-10) Runs: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2(2001-10-10) Long run: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS 140-2(2001-10-10) Continuous run: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: HRNG source speed: (min=383.169; avg=682.328; max=883.247)Kibits/s
Jan 18 16:57:45 raspberrypi rngd[343]: stats: FIPS tests speed: (min=4.941; avg=5.506; max=5.829)Mibits/s
Jan 18 16:57:45 raspberrypi rngd[343]: stats: Lowest ready-buffers level: 2
Jan 18 16:57:45 raspberrypi rngd[343]: stats: Entropy starvations: 0
Jan 18 16:57:45 raspberrypi rngd[343]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us
Jan 18 16:57:58 raspberrypi sudo[3889]: pam_unix(sudo:session): session closed for user root
Jan 18 16:58:07 raspberrypi sudo[3899]:     ben2 : TTY=pts/0 ; PWD=/home/ben2 ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 18 16:58:07 raspberrypi sudo[3899]: pam_unix(sudo:session): session opened for user root by ben2(uid=0)
ben2@raspberrypi:~ $


Is this actualy in the conf files with those trailing ``` ?

cat /etc/unbound/unbound.conf

cat /etc/unbound/unbound.conf.d/qname-minimisation.conf

Those three ``` shouldn't be there.

no, the "trailing" is maybe because i did all these command on my iphone.

i tested now everything on my notebook, all seams ok so far ...

pls see last posting

I dont have unbound but this unbound-resolvconf.service sounds suspicious.

Na unbound-resolvconf.service is normal it seems.
I dont have unbound but what messages do you get if start manually and not via systemd ?

sudo /usr/sbin/unbound -d -c /etc/unbound/unbound.conf

Or:

sudo strace -f /usr/sbin/unbound -d -c /etc/unbound/unbound.conf

And outa interest, what does below show ?

cat /proc/sys/kernel/random/entropy_avail

getpid()                                = 5673
getpid()                                = 5673
mmap2(NULL, 241664, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x761ef000
socketpair(AF_UNIX, SOCK_STREAM, 0, [6, 7]) = 0
fcntl64(6, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(6, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
getpid()                                = 5673
munmap(0x7622a000, 266240)              = 0
getuid32()                              = 109
geteuid32()                             = 109
getgid32()                              = 114
getegid32()                             = 114
getuid32()                              = 109
geteuid32()                             = 109
getgid32()                              = 114
getegid32()                             = 114
epoll_create1(EPOLL_CLOEXEC)            = 8
getuid32()                              = 109
geteuid32()                             = 109
getgid32()                              = 114
getegid32()                             = 114
pipe2([9, 10], O_NONBLOCK|O_CLOEXEC)    = 0
getuid32()                              = 109
geteuid32()                             = 109
getgid32()                              = 114
getegid32()                             = 114
rt_sigprocmask(SIG_UNBLOCK, [HUP], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [INT], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [QUIT], NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [TERM], NULL, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=0x76e5dd88, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, {sa_handler=0x1a15c, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, 8) = 0
epoll_ctl(8, EPOLL_CTL_ADD, 9, {EPOLLIN, {u32=9, u64=9}}) = 0
rt_sigaction(SIGQUIT, {sa_handler=0x76e5dd88, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, {sa_handler=0x1a15c, sa_mask=[QUIT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x76e5dd88, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, {sa_handler=0x1a15c, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, 8) = 0
rt_sigaction(SIGINT, {sa_handler=0x76e5dd88, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, {sa_handler=0x1a15c, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, 8) = 0
brk(0x1602000)                          = 0x1602000
epoll_ctl(8, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=4, u64=4}}) = 0
brk(0x1632000)                          = 0x1632000
brk(0x1662000)                          = 0x1662000
brk(0x1692000)                          = 0x1692000
epoll_ctl(8, EPOLL_CTL_ADD, 3, {EPOLLIN, {u32=3, u64=3}}) = 0
brk(0x16c2000)                          = 0x16c2000
brk(0x16f2000)                          = 0x16f2000
brk(0x1722000)                          = 0x1722000
brk(0x1743000)                          = 0x1743000
brk(0x1764000)                          = 0x1764000
brk(0x1785000)                          = 0x1785000
brk(0x17a6000)                          = 0x17a6000
brk(0x17c7000)                          = 0x17c7000
brk(0x17e8000)                          = 0x17e8000
brk(0x1809000)                          = 0x1809000
brk(0x182a000)                          = 0x182a000
brk(0x184b000)                          = 0x184b000
brk(0x186c000)                          = 0x186c000
brk(0x188d000)                          = 0x188d000
brk(0x18ae000)                          = 0x18ae000
brk(0x18cf000)                          = 0x18cf000
brk(0x1924000)                          = 0x1924000
epoll_ctl(8, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
brk(0x1948000)                          = 0x1948000
brk(0x196c000)                          = 0x196c000
brk(0x1990000)                          = 0x1990000
brk(0x19b4000)                          = 0x19b4000
brk(0x19d8000)                          = 0x19d8000
brk(0x19fc000)                          = 0x19fc000
brk(0x1a20000)                          = 0x1a20000
brk(0x1a44000)                          = 0x1a44000
brk(0x1a68000)                          = 0x1a68000
brk(0x1a8c000)                          = 0x1a8c000
brk(0x1ab0000)                          = 0x1ab0000
brk(0x1ad9000)                          = 0x1ad9000
openat(AT_FDCWD, "/var/lib/unbound/root.hints", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
getpid()                                = 5673
brk(0x1afb000)                          = 0x1afb000
send(5, "<27>Jan 18 21:41:42 unbound: [56"..., 125, MSG_NOSIGNAL) = 125
getpid()                                = 5673
send(5, "<27>Jan 18 21:41:42 unbound: [56"..., 77, MSG_NOSIGNAL) = 77
getpid()                                = 5673
send(5, "<30>Jan 18 21:41:42 unbound: [56"..., 159, MSG_NOSIGNAL) = 159
getpid()                                = 5673
send(5, "<30>Jan 18 21:41:42 unbound: [56"..., 115, MSG_NOSIGNAL) = 115
epoll_ctl(8, EPOLL_CTL_DEL, 3, 0x7e8763b8) = 0
epoll_ctl(8, EPOLL_CTL_DEL, 4, 0x7e8763b8) = 0
rt_sigaction(SIGINT, {sa_handler=0x1a15c, sa_mask=[INT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, NULL, 8) = 0
rt_sigaction(SIGTERM, {sa_handler=0x1a15c, sa_mask=[TERM], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, NULL, 8) = 0
rt_sigaction(SIGQUIT, {sa_handler=0x1a15c, sa_mask=[QUIT], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, NULL, 8) = 0
rt_sigaction(SIGHUP, {sa_handler=0x1a15c, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x765f3120}, NULL, 8) = 0
epoll_ctl(8, EPOLL_CTL_DEL, 6, 0x7e8763c0) = 0
close(6)                                = 0
close(7)                                = 0
munmap(0x761ef000, 241664)              = 0
epoll_ctl(8, EPOLL_CTL_DEL, 9, 0x7e876398) = 0
close(9)                                = 0
close(10)                               = 0
close(8)                                = 0
getpid()                                = 5673
send(5, "<26>Jan 18 21:41:42 unbound: [56"..., 83, MSG_NOSIGNAL) = 83
exit_group(1)                           = ?
+++ exited with 1 +++
root@raspberrypi:~#

no ouput, no error, just not working, tried also to restart the raspberry, no chance ...

i will start from zero now, flash a new image, install pihole, install unbound, i will try to install directly the version 1.9.6

It says it cant find root.hints.

https://docs.pi-hole.net/guides/unbound/

@deHakkelaar It is rather speculative to conclude this from the entropy output. I see no tries to open any config file at all therein. This failed open might be before it even tries to read from the config and may be totally non-fatal. Or it could even be from another binary (maybe trying to update the root hints).

Hmm, so let's try with some added verbosity

sudo /usr/sbin/unbound -d -vvv -c /etc/unbound/unbound.conf

And mind, no output could also simply mean: It works.

Users need to keep testing us to stay sharp :wink:

dehakkelaar@laptop:~$ cat /proc/sys/kernel/random/entropy_avail
1756

dehakkelaar@laptop:~$ sudo apt install unbound
[..]
unbound is already the newest version (1.6.0-3+deb9u2).

dehakkelaar@laptop:~$ sudo grep -v '^\s*#\|^\s*$' -R /etc/unbound/unbound.conf.d/pi-hole.conf
server:
    verbosity: 0
    port: 5353
    do-ip4: yes
    do-udp: yes
    do-tcp: yes
    do-ip6: no
    root-hints: "/var/lib/unbound/root.hints"
    harden-glue: yes
    harden-dnssec-stripped: yes
    use-caps-for-id: no
    edns-buffer-size: 1472
    prefetch: yes
    num-threads: 1
    so-rcvbuf: 1m
    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

dehakkelaar@laptop:~$ sudo strace -f /usr/sbin/unbound -d -c /etc/unbound/unbound.conf
sudo: strace: command not found

dehakkelaar@laptop:~$ sudo apt install strace
[..]
Unpacking strace (4.15-2) ...
Setting up strace (4.15-2) ...
Processing triggers for man-db (2.7.6.1-2) ...

dehakkelaar@laptop:~$ sudo strace -f /usr/sbin/unbound -d -c /etc/unbound/unbound.conf
[..]
open("/var/lib/unbound/root.hints", O_RDONLY) = -1 ENOENT (No such file or directory)
[..]

dehakkelaar@laptop:~$ sudo stat /var/lib/unbound/root.hints
stat: cannot stat '/var/lib/unbound/root.hints': No such file or directory

dehakkelaar@laptop:~$ wget -O root.hints https://www.internic.net/domain/named.root
[..]
2020-01-19 12:02:38 (13.0 MB/s) - ‘root.hints’ saved [3316/3316]
[..]

dehakkelaar@laptop:~$ sudo mv root.hints /var/lib/unbound/
dehakkelaar@laptop:~$

dehakkelaar@laptop:~$ sudo strace -f /usr/sbin/unbound -d -c /etc/unbound/unbound.conf
[..]
open("/var/lib/unbound/root.hints", O_RDONLY) = 12
[..]
dehakkelaar@laptop:~$ sudo rm /var/lib/unbound/root.hints
dehakkelaar@laptop:~$

dehakkelaar@laptop:~$ sudo /usr/sbin/unbound -d -vvv -c /etc/unbound/unbound.conf
[1579433035] unbound[8194:0] notice: Start of unbound 1.6.0.
[1579433035] unbound[8194:0] debug: switching log to syslog

dehakkelaar@laptop:~$ sudo tail /var/log/syslog
[..]
Jan 19 12:23:55 laptop unbound: [8194:0] error: could not read root hints /var/lib/unbound/root.hints: No such file or directory
Jan 19 12:23:55 laptop unbound: [8194:0] error: Could not set root or stub hints
Jan 19 12:23:55 laptop unbound: [8194:0] info: server stats for thread 0: 0 queries, 0 answers from cache, 0 recursions, 0 prefetch
Jan 19 12:23:55 laptop unbound: [8194:0] info: server stats for thread 0: requestlist max 0 avg 0 exceeded 0 jostled 0
Jan 19 12:23:55 laptop unbound: [8194:0] info: mesh has 0 recursion states (0 with reply, 0 detached), 0 waiting replies, 0 recursion replies sent, 0 replies dropped, 0 states jostled out
Jan 19 12:23:55 laptop unbound: [8194:0] debug: cache memory msg=66072 rrset=66072 infra=2632 val=66344
Jan 19 12:23:55 laptop unbound: [8194:0] fatal error: Could not initialize main thread

ok, after hour of reading here as well as in other forums and trying to unterstand whats wrong with my setup:

  • as supposed: the config file was in different folders:

/usr/local/etc/unbound/unbound.conf

/etc/unbound/unbound.conf

aslo here: NLnet Labs Documentation - Unbound - Howto Setup and Install

/etc/unbound.conf

the first one (/usr/local/etc/unbound/unbound.conf) needed to config to use the right port: 5335
after that change i got it working.

also after installing the this new version, unbound was not starting as a service, after reboot i was forced to start unbound with sudo unbound ...

it is kind of mess: wich file has to be placed in wich folfer / path ...

RIGHT now: everything is fine also startings as service :smile:

with this NEW version 1.9.6 also comes a new config-file:

unbound.conf.txt (39.4 KB)

Not of much value. The uncommented lines amount to this:

server:
	verbosity: 1
         interface: 127.0.0.1@5335
	 port: 5335
	 access-control: 127.0.0.0/8 allow
python:
remote-control:

Best to stick with the config file in the Pi-Hole unbound guide, in my opinion; it already has the approrpiate lines uncommented.

i am sure you are right!

but, where should be the right path for the conf-file?

also it would be perfect if someone with more knowledge write up a short how to for the new version 1.9.6

Minus the keys and certificates, here are the configuration lines from a functioning unbound V1.90 set up per the Pi-Hole guide (and with remote control enabled):

/etc/unbound/unbound.conf:include: "/etc/unbound/unbound.conf.d/*.conf"

/etc/unbound/unbound.conf.d/qname-minimisation.conf:server:
/etc/unbound/unbound.conf.d/qname-minimisation.conf:    qname-minimisation: yes

/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf:server:
/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf:    auto-trust-anchor-file: "/var/lib/unbound/root.key"

/etc/unbound/unbound.conf.d/pi-hole.conf: server:
/etc/unbound/unbound.conf.d/pi-hole.conf:    verbosity: 1
/etc/unbound/unbound.conf.d/pi-hole.conf:    port: 5353
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-ip4: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-udp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-tcp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-ip6: no
/etc/unbound/unbound.conf.d/pi-hole.conf:    root-hints: "/var/lib/unbound/root.hints"
/etc/unbound/unbound.conf.d/pi-hole.conf:    harden-glue: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    harden-dnssec-stripped: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    edns-buffer-size: 1472
/etc/unbound/unbound.conf.d/pi-hole.conf:    prefetch: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    num-threads: 1
/etc/unbound/unbound.conf.d/pi-hole.conf:    so-rcvbuf: 1m
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 192.168.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 169.254.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 172.16.0.0/12
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 10.0.0.0/8
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: fd00::/8
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: fe80::/10
/etc/unbound/unbound.conf.d/pi-hole.conf:remote-control:
/etc/unbound/unbound.conf.d/pi-hole.conf:	control-enable: yes

Probably the compile/configure options have /usr/local/etc/unbound/unbound.conf as default.
Check/edit below file to get on track and use /etc/unbound/unbound.conf instead:

dehakkelaar@laptop:~$ head /usr/lib/unbound/package-helper
#!/bin/sh -e

UNBOUND_CONF="/etc/unbound/unbound.conf"
UNBOUND_BASE_DIR="$(dirname $UNBOUND_CONF)"
CHROOT_DIR="$(unbound-checkconf -o chroot)"

DNS_ROOT_KEY_FILE="/usr/share/dns/root.key"
ROOT_TRUST_ANCHOR_FILE="/var/lib/unbound/root.key"

# Override these variables by editing or creating /etc/default/unbound.

Restart unbound to apply:

sudo service unbound restart

And test:

dehakkelaar@laptop:~$ dig +short @127.0.0.1 -p 5353 chaos txt version.bind
"unbound 1.6.0"

dehakkelaar@laptop:~$ dig +short @127.0.0.1 -p 5353 pi-hole.net
206.189.252.21

Ps. below the guide defaults (including unbound V1.6.0 package defaults):

dehakkelaar@laptop:~$ sudo grep -v '^\s*#\|^\s*$' -R /etc/unbound/unbound.conf* --include=*.conf | sort
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-ip4: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-ip6: no
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-tcp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    do-udp: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    edns-buffer-size: 1472
/etc/unbound/unbound.conf.d/pi-hole.conf:    harden-dnssec-stripped: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    harden-glue: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    num-threads: 1
/etc/unbound/unbound.conf.d/pi-hole.conf:    port: 5353
/etc/unbound/unbound.conf.d/pi-hole.conf:    prefetch: yes
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 10.0.0.0/8
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 169.254.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 172.16.0.0/12
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: 192.168.0.0/16
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: fd00::/8
/etc/unbound/unbound.conf.d/pi-hole.conf:    private-address: fe80::/10
/etc/unbound/unbound.conf.d/pi-hole.conf:    root-hints: "/var/lib/unbound/root.hints"
/etc/unbound/unbound.conf.d/pi-hole.conf:server:
/etc/unbound/unbound.conf.d/pi-hole.conf:    so-rcvbuf: 1m
/etc/unbound/unbound.conf.d/pi-hole.conf:    use-caps-for-id: no
/etc/unbound/unbound.conf.d/pi-hole.conf:    verbosity: 0
/etc/unbound/unbound.conf.d/qname-minimisation.conf:    qname-minimisation: yes
/etc/unbound/unbound.conf.d/qname-minimisation.conf:server:
/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf:    auto-trust-anchor-file: "/var/lib/unbound/root.key"
/etc/unbound/unbound.conf.d/root-auto-trust-anchor-file.conf:server:
/etc/unbound/unbound.conf:include: "/etc/unbound/unbound.conf.d/*.conf"

EDIT: mabye even better put below line:

UNBOUND_CONF="/etc/unbound/unbound.conf"

In below file that might do the trick:

/etc/default/unbound

If file dont exist, just create new one eg:

sudo nano /etc/default/unbound

I followed your steps, but it still shows 1.9.0.
What am i doing wrong ?

pi@raspberrypi:/etc/unbound/unbound $ unbound -V
unbound: invalid option -- 'V'
usage: unbound [options]
start unbound daemon DNS resolver.
-h this help
-c file config file to read instead of /etc/unbound/unbound.conf
file format is described in unbound.conf(5).
-d do not fork into the background.
-p do not create a pidfile.
-v verbose (more times to increase verbosity)
Version 1.9.0
linked libs: libevent 2.1.8-stable (it uses epoll), OpenSSL 1.1.1d 10 Sep 2019
linked modules: dns64 python subnetcache respip validator iterator
BSD licensed, see LICENSE in source package for details.
Report bugs to unbound-bugs@nlnetlabs.nl

If you installed Unbound via your distributions repository (Debian/Ubuntu/Raspian) then version 1.9.0 is the latest one. See here.

For 1.9.6 you have to compile it yourself.

I need the steps to do it myself pls.
i tried following many guides, but couldnt succeed. i am missing something or there are many changes in file structure. thats why i am not able to do it successfully.

Pls any dev guide me. Thanks in advance