Pi hole not resolving DNS queries from PiHole

Expected Behaviour:

I running PiHole on ubuntu server 22.04.1 with static IP. Hardware Odroid N2 4GB SBC.I also have cloudflared installed. Custom DNS is set to 127.0.0.1#5053. When I preform a nslookup to pi-hole.net this is the output
nslookup pi-hole.net
Server: 192.168.1.1
Address: 192.168.1.1#53
Non-authoritative answer:
Name: pi-hole.net
Address: 3.18.136.52

dig command reply:
dig @127.0.0.1 -p 5053 google.com
communications error to 127.0.0.1#5053: connection refused

netstat
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 localhost:4711 0.0.0.0:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:domain [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 0.0.0.0:52898 0.0.0.0:*
udp 0 0 0.0.0.0:36585 0.0.0.0:*
udp 0 0 0.0.0.0:domain 0.0.0.0:*
udp 0 0 0.0.0.0:57823 0.0.0.0:*
udp 0 0 0.0.0.0:37521 0.0.0.0:*
udp6 0 0 [::]:domain [::]:*
raw6 0 0 [::]:ipv6-icmp [::]:* 7

Actual Behaviour:

If I change DNS server in my router to my pihole(192.168.1.88) none my computers are able to resolve dns queries.

Debug Token:

https://tricorder.pi-hole.net/eYwyUnhc/

That custom DNS has to accept DNS queries from your Pi-hole on the same machine.

Currently, it does not:

Whatever DNS resolver is listening on 127.0.0.1#5053, verify its configuration and allow it to accept incoming DNS queries from localhost processes (like Pi-hole).

Your debug log does not show any process running on port 5053.

Adding to the comments above... nothing indicates this will work, because the debug log doesn't show a DNS resolver using this port.

You said:

Why did you set it like this?

I set this up according to the cloudflared (DoH) install documentation guide

How do I get the port 5053 configured to allow DNS traffic?

You need to fix your Cloudlared install. It is not shown as running on port 5053.

I remove the cloudflared install.

Changed my windows PC DNS server to my PiHole and ran nslookup

nslookup espn.com 192.168.1.88
Server: pi.hole
Address: 192.168.1.88

DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to pi.hole timed-out

nslookup espn.com
Server: pfSenseRouter.localdomain
Address: 192.168.1.1

Non-authoritative answer:
Name: espn.com
Addresses: 2600:9000:20be:4200:d:ac18:e2c0:93a1
2600:9000:20be:6a00:d:ac18:e2c0:93a1
2600:9000:20be:ac00:d:ac18:e2c0:93a1
2600:9000:20be:8600:d:ac18:e2c0:93a1
2600:9000:20be:200:d:ac18:e2c0:93a1
2600:9000:20be:3a00:d:ac18:e2c0:93a1
2600:9000:20be:5200:d:ac18:e2c0:93a1
2600:9000:20be:b000:d:ac18:e2c0:93a1
52.84.162.100
52.84.162.81
52.84.162.57
52.84.162.90

Nslookup from Pihole
nslookup espn.com
Server: 192.168.1.1
Address: 192.168.1.1#53

Non-authoritative answer:
Name: espn.com
Address: 18.65.229.61
Name: espn.com
Address: 18.65.229.93
Name: espn.com
Address: 18.65.229.14
Name: espn.com
Address: 18.65.229.26
Name: espn.com
Address: 2600:9000:20be:5200:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:b000:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:4200:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:6a00:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:ac00:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:8600:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:200:d:ac18:e2c0:93a1
Name: espn.com
Address: 2600:9000:20be:3a00:d:ac18:e2c0:93a1

What else should I check/change to get PiHole to resolve DNS requests.

re installed Ubuntu server 22.04. I still cant get pihole to resolve dns queries.

Server has static
IP 192.168.1.88/24
Gateway 192.168.1.1
DNS 192.168.1.1

nslookup youtube.com
Server: 192.168.1.1
Address: 192.168.1.1#53

I have changed the nameserver 1.1.1.1 in resolve.conf file. It still wont resolve DNS queries. What are the correct network server settings once pi hole is installed?

Debug log https://tricorder.pi-hole.net/Bxjz0Yyc/

It is my understanding that the IP address of the pi-hole itself should be used as the DNS server as well -- yes, it uses itself, then the software then uses your choice of upstream DNS on the same computer / device that's running the pi-hole.

The gateway is fine, it should definitely go to the router.

No I wouldnt do that.
In the past, the Pi-hole installer would configure the host to use the local (loopback) IP and that caused allot of headaches.
This bc if the pihole-FTL daemon would break for some reason, an update, a tweak or change, all processes on the host wouldn't be able to resolve via DNS anymore making things harder to troubleshoot.
You wouldnt even be able to run the Pi-hole repair command pihole -r

1 Like

From above, it appears a reverse lookup is working as your 192.168.1.88 IP is correctly identified as being pi.hole.
But I suspect you have troubles with the upstream configured DNS server(s) for Pi-hole when trying to resolve espn.com wich needs to be forwarded upstream.
What is/are your upstream configured DNS servers when run below?

nslookup -class=chaos -type=txt servers.bind 192.168.1.88

And can you run nslookup against them successfully?

To speed things up, you could generate a new debug token for the mods/devs to have a look at this current changed setup.
The old one expired after I believe 48 hours.

I finally got the pi hole to resolve dns requests. It was a firewall issue on my end. Now the issue with the cloudflared service it will not start. The service status is stuck on "activating". Has any one experienced this issue? Followed this guide cloudflared (DoH) - Pi-hole documentation

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