Pihole and unbound, all queries go to Google

The issue I am facing:
I have installed pi-hole along with unbound on my pi and set it up to query the authoritative servers (eg root servers etc) and not as a forwarder dns. ie I have nothing in my phhole - dns - upstream dns listed but under custom 1 I have 127.0.0.1#5335
Pihole is working and blocking ads.
I did a dns leak test at dnsleaktest.com.and I expected to see my IP address as the dns servers or the dns of the authoritative dns servers but all I got was a list of 26 Google DNS servers all based in London.

Is this correct and I making the wrong assumption

How can I see what DNS servers pi-hole/unbound is actually talking to?

Details about my system:
Pi-hole installed a vanilla Raspberry Pi Zero W running the latest raspbian (bullseye)

My clinet windows PC is win10 and configured for DNS to 192.168.0.2, the ip of pihole
What I have changed since installing Pi-hole:
Nothing.

From which client and browser was this test run? Have you checked that browser to see if private or secure DNS is active on the browser?

Hi and thanks for the reply.

The dns leak test was done on Firefox 94.0.1 on my win10 pc (i have also checked on my linux notebook) and the results are the same...

IP Hostname ISP Country
172.217.32.1 None Google London, United Kingdom
172.217.35.67 None Google London, United Kingdom
172.217.47.129 None Google London, United Kingdom
172.217.47.130 None Google London, United Kingdom
172.217.47.132 None Google London, United Kingdom
74.125.43.129 None Google London, United Kingdom

The settings for DNS over HTTPS is not set in firefox network settings. ie unticked

You can see the destinations for upstream Pi-hole queries either on the dashboard (there is a pie chart) or with this command from the Pi terminal:

echo ">forward-dest >quit" | nc localhost 4711

Also, please post the output of this command which will show your unbound configuration:

sudo grep -v '#\|^$' -R /etc/unbound/unbound.conf*

Edit - and from the Windows 10 PC, from the command prompt or terminal on that client (and not via ssh or Putty to the Pi), what is the output of

nslookup pi.hole

pi@pihole:~ $ echo ">forward-dest >quit" | nc localhost 4711
-2 1.50 blocklist blocklist
-1 71.90 cache cache
0 26.60 127.0.0.1#5335 localhost#5335

pi@pihole:~ $ sudo grep -v '#|^$' -R /etc/unbound/unbound.conf*
/etc/unbound/unbound.conf:include-toplevel: "/etc/unbound/unbound.conf.d/*.conf"
/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: 0
/etc/unbound/unbound.conf.d/pi-hole.conf: interface: 127.0.0.1
/etc/unbound/unbound.conf.d/pi-hole.conf: port: 5335
/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: prefer-ip6: no
/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: use-caps-for-id: no
/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/resolvconf_resolvers.conf:forward-zone:
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: name: "192.168.0.2"
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: forward-addr: 8.8.8.8
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: forward-addr: 8.8.4.4
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf:forward-zone:
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: name: "."
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: forward-addr: 8.8.8.8
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: forward-addr: 8.8.4.4
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf: forward-addr: fdb7:aaec:b855:0:7250:afff:fe44:4078
pi@pihole:~ $

And from my Win10 pc here is the nslookup

C:\Users\John>nslookup pi.hole
Server: pi.hole
Address: 192.168.0.2

Name: pi.hole
Addresses: fdb7:aaec:b855:0:91ef:6731:bb2c:da25
192.168.0.2

C:\Users\John>

Additional info, my etc/dhcpcd.conf is...

> # A sample configuration for dhcpcd.
> # See dhcpcd.conf(5) for details.
> 
> # Allow users of this group to interact with dhcpcd via the control socket.
> #controlgroup wheel
> 
> # Inform the DHCP server of our hostname for DDNS.
> hostname
> 
> # Use the hardware address of the interface for the Client ID.
> clientid
> # or
> # Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
> # Some non-RFC compliant DHCP servers do not reply with this set.
> # In this case, comment out duid and enable clientid above.
> #duid
> 
> # Persist interface configuration when dhcpcd exits.
> persistent
> 
> # Rapid commit support.
> # Safe to enable by default because it requires the equivalent option set
> # on the server to actually work.
> option rapid_commit
> 
> # A list of options to request from the DHCP server.
> option domain_name_servers, domain_name, domain_search, host_name
> option classless_static_routes
> # Respect the network MTU. This is applied to DHCP routes.
> option interface_mtu
> 
> # Most distributions have NTP support.
> #option ntp_servers
> 
> # A ServerID is required by RFC2131.
> require dhcp_server_identifier
> 
> # Generate SLAAC address using the Hardware Address of the interface
> #slaac hwaddr
> # OR generate Stable Private IPv6 Addresses based from the DUID
> slaac private
> 
> # Example static IP configuration:
> #interface eth0
> #static ip_address=192.168.0.10/24
> #static ip6_address=fd51:42f8:caae:d92e::ff/64
> #static routers=192.168.0.1
> #static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
> 
> # It is possible to fall back to a static IP if DHCP fails:
> # define static profile
> #profile static_eth0
> #static ip_address=192.168.1.23/24
> #static routers=192.168.1.1
> #static domain_name_servers=192.168.1.1
> 
> # fallback to static profile on eth0
> #interface eth0
> #fallback static_eth0
> 
> interface wlan0
> inform 192.168.0.2
> static routers=192.168.0.1
> static domain_name_servers=192.168.0.1
> static domain_search=192.168.0.2
> interface wlan0
>         static ip_address=192.168.0.2/24
>         static routers=192.168.0.1
>         static domain_name_servers=8.8.8.8 8.8.4.4

**my /etc/resolv.conf is...**

# Generated by resolvconf
search 192.168.0.2
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver fdb7:aaec:b855:0:7250:afff:fe44:4078

and my /etc/resolvconf.conf is...


# Configuration for resolvconf(8)
# See resolvconf.conf(5) for details

resolv_conf=/etc/resolv.conf
# If you run a local name server, you should uncomment the below line and
# configure your subscribers configuration files below.
#name_servers=127.0.0.1


> # Mirror the Debian package defaults for the below resolvers
> # so that resolvconf integrates seemlessly.
> dnsmasq_resolv=/var/run/dnsmasq/resolv.conf
> pdnsd_conf=/etc/pdnsd.conf
> unbound_conf=/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf

just to make sure this isn't the cause, comment out the dnsmasq and unbound lines in /etc/resolvconf.conf:

#dnsmasq_resolv=/var/run/dnsmasq/resolv.conf
pdnsd_conf=/etc/pdnsd.conf
#unbound_conf=/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf

and check /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf doesn't exist, if it does, delete it and restart unboud (or reboot).

For additional info here is also my debug log
https://tricorder.pi-hole.net/BF15T13d/

Thanks jpgpi250,

I have commented out the 2 lines in my /etc/resolvconf.conf file

I have deleted the /etc/unbound/unbound.conf.d/resolvconf_resolvers.conf

I have then rebooted.

I did another dnsleaktest and it now just shows my isp ip which means it's working.
Great for your help and appreciate it.

For more information for any noobs like me, I followed a tutorial on how to install pi-hole and use it as a recursive dns server using unbound. The tutorial is Youtube-Craft Computing

If you install on the latest Raspbian (Bullseye) it appears that there is differences (from Buster) and you need to shut down the unbound-resolvconf.service.

Refer to the unbound section https://docs.pi-hole.net/guides/dns/unbound/ and find the " Disable resolvconf for unbound (optional)" and implement this to shut the service down. Then you need to follow the solution above by jpgpi250 to comment out lines from /etc/resolvconf.conf
and delete
/etc/unbound/unbound.conf.d/resolvconf_resolvers.conf

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.