pihole Cannot Resolve DNS

Expected Behaviour:

I set up pihole following the installation guide on a Raspberry Pi running Debian GNU/Linux 13 (trixie).

The upstream DNS is set to Google, and the DNS server on the router points to the static IP of the Pi (192.168.1.66). Expected to have normal name resolution.

Actual Behaviour:

Internet connection works, but name resolution fails for all websites.

ping 8.8.8.8 works. ping google.com times out.

Read online it could be rebind protection on the router, but see no option to turn it off in the router settings and not sure how to verify if that's what's happening (newbie).

Debug Token:

xyrdrSpY

On the Raspberry Pi terminal, execute these commands and post the output here:

nslookup google.com
 
nslookup google.com 192.168.1.66

Also, make sure your OS (and router) doesn't have any firewall rules blocking port 53.

I tried disabling the firewall on the router entirely to test (there's an option to do this in the router interface). I also checked if ufw is active on the pihole device via sudo ufw status and I get:

Status: inactive

I'm guessing that means that there's no active firewall on the machine itself, but not sure if there's anything else I need to check.

The two nslookups produce the same result, namely:

» nslookup google.com
;; communications error to 192.168.1.66#53: timed out
;; communications error to 192.168.1.66#53: timed out
;; communications error to 192.168.1.66#53: timed out
;; communications error to fe80::a16:5ff:fe95:82b0%2#53: timed out
;; no servers could be reached

» nslookup google.com 192.168.1.66                             1 ↵
;; communications error to 192.168.1.66#53: timed out
;; communications error to 192.168.1.66#53: timed out
;; communications error to 192.168.1.66#53: timed out
;; no servers could be reached

  • Where did you enter that : LAN or WAN settings ?
  • How did you configure the Static IP Address for the Raspberry Pi ?
  • What is the DNS Server that the Raspberry Pi itself is using ?

I am guessing you made a loop somewhere and the above things are very important/crucial pieces of that puzzle !!

Where did you enter that : LAN or WAN settings ?

I don't see separate sections for that in the router settings. See screenshot.

How did you configure the Static IP Address for the Raspberry Pi ?

I added the following to /etc/dhcpcd.conf:

static ip_address=192.168.1.66
static routers=192.168.1.1
static domain_name_servers=1.1.1.1 8.8.8.8

What is the DNS Server that the Raspberry Pi itself is using ?

I'm not sure I understood the question correctly, but if you mean what are the upstream DNS servers, they're Google's servers.

» sudo pihole-FTL --config dns.upstream
dns.upstreams = [ 8.8.4.4, 8.8.8.8 ]

The image shows you set Pi-hole as the DNS server in "Internet" page.

This is a guess, since I don't have a similar device, but try the "Settings" page.
It is possible that you can find a LAN or DHCP submenu there.

If you do, please set DNS server on the LAN/DHCP page (then restore the DNS settings to the default in "Internet").

There are some DHCP settings there, but it seems I can only set the address pool, lease expiry time, and reserve static addresses there. (The static IP for the Pi works with just /etc/dhcpcd.conf changes, so I didn't add it to the router as well.)

The other subheadings don't seem to be related to this. Configuration only has options to save or reset the existing configuration of the router.

Generic Modem has a WAN section, but that shouldn't be it, if I understood you correctly.

When I manually set the DNS under Internet to 1.1.1.1, the output of nslookup changes like so. Not sure if that tells us anything. Does the fact that the Server in the output does not match what I entered in the setting mean that this does not govern DNS for DHCP/LAN after all?

nslookup google.com
Server:		8.8.8.8
Address:	8.8.8.8#53

Non-authoritative answer:
Name:	google.com
Address: 192.178.194.113
Name:	google.com
Address: 192.178.194.138
Name:	google.com
Address: 192.178.194.101
Name:	google.com
Address: 192.178.194.139
Name:	google.com
Address: 192.178.194.102
Name:	google.com
Address: 192.178.194.100
Name:	google.com
Address: 2a00:1450:4025:1807::8a
Name:	google.com
Address: 2a00:1450:4025:1807::65
Name:	google.com
Address: 2a00:1450:4025:1807::64
Name:	google.com
Address: 2a00:1450:4025:1807::8b

On some router, the WiFi is equate to LAN. Check out the WiFi tab and see if you see any DNS settings there

Apparently each Vodafone device has a different set of settings; like the one from this post: Router IPv6 and Pi-hole DHCP

You should keep your current settings, using Pi-hole in Internet page.

Checked and unfortunately no option to set DNS in the WiFi tab.

When I set the DNS to 192.168.1.66 under the Internet tab, I get the timeouts. When I set it to 1.1.1.1, I get the response above, where the nslookup tells me I'm getting the name resolution from 8.8.8.8. (In the latter case, for obvious reasons, the ad blocking does not work.) Is there anything else I can try to troubleshoot?

Debian 13 (Trixie) does not use dhcpcd for network configuration AFAIK ?!

You need either NetworkManager or that new NetPlan stuff I read about some time ago in case of Raspberry Pi OS.
Another option is to do everything via SystemD and ignore everything else.

You have tried to configure Cloudflare and Google as the DNS Servers for Raspberry Pi OS and that's perfectly fine, but double check if :

  • They are written in /etc/resolv.conf
  • If nslookup on the Raspberry Pi itself shows that they are indeed used by the OS.

Good luck! :slight_smile: