First check if your effected by a recent change that was made in the openresolv
package that comes with Pi-OS Bullseye:
pi@ph5b:~ $ lsb_release -d
Description: Raspbian GNU/Linux 11 (bullseye)
pi@ph5b:~ $ apt policy openresolv
openresolv:
Installed: 3.12.0-1
Does below file exist and what is its content?
cat /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf
If exists, delete it with below one because it configures Unbound to function like a regular forwarding DNS server instead of a recursive DNS server and could also create a DNS loop which will cause things to break:
sudo rm /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf
And run below one to make sure above file does not get re-created when rebooting.
It places a hash/comment sign # in front of the config line that creates above file:
sudo sed -i 's\^unbound_conf=\#unbound_conf=\' /etc/resolvconf.conf
Run below to apply or reboot:
sudo service unbound restart
And test again.