No, for Pi-OS Bullseye and maybe even Debian, check if below file exists first:
cat /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf
If exists, delete it with below so unbound
becomes a true recursive resolver again:
sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf
Make sure it doesnt get recreated at boot or network state change by hashing out # the unbound_conf=
line in below file:
sudo sed -i 's/^unbound_conf=/#unbound_conf=/' /etc/resolvconf.conf
Restart unbound
to apply:
sudo service unbound restart
Also check if the unbound-resolvconf.service
unit is active with below:
service unbound-resolvconf status
It populates /etc/resolv.conf
with the (unwanted) loopback IP 127.0.0.1 nameserver
instead of the one thats configured in /etc/dhcpcd.conf
.
Can disable and stop that one with below:
sudo systemctl disable --now unbound-resolvconf.service
Restart the dhcpcd
network manager to apply:
sudo service dhcpcd restart
And check if resolv.conf
now contains the domain_name_servers=
IP's from /etc/dhcpcd.conf
:
pi@ph5b:~ $ tail /etc/dhcpcd.conf
[..]
interface eth0
static ip_address=10.0.0.4/24
static routers=10.0.0.1
static domain_name=home.dehakkelaar.nl
static domain_name_servers=10.0.0.1
pi@ph5b:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain home.dehakkelaar.nl
nameserver 10.0.0.1