Please follow the below template, it will help us to help you!
I am running pihole (version 2023.01.3) on a kubernetes cluster on a raspberry pi with a unifi dream router. In the unifi router I have set the pi as my DHCP DNS Server:
On my pihole I have set the router's IP as the upstream DNS server:
With local DNS forwarding activated:
Since I have been using it for a while now without any troubles, I was not checking on the pihole regularly. However, recently I have figured that the number of requests is not really high. Therefore I wanted to test whether the pihole is actually running as I alway thought it was.
So I tried out local DNS config and set up a couple of DNS records like:
raspberry.local
However I cannot reach the pihole's site with the local DNS record. I can however reach it via the raspberry's IP address 192.168.2.106:6969/admin (yeah - changed the port to 6969).
nslookup gives the following:
Reaching the right side typing in raspberry.local:6969/admin
Actual Behaviour:
Site not found.
So I am actually challenging my whole setup. And I am not sure whether my pihole is working overall. Do you have tips how to test it if it is working correctly? If it is working, why is local DNS not working?
The machine you ran that nslookup from is using your router at 192.168.2.1 as DNS server, not Pi-hole.
Your debug log shows your DHCP server to correctly distribute your Pi-hole host's IP as DNS server:
*** [ DIAGNOSING ]: Discovering active DHCP servers (takes 10 seconds)
Scanning all your interfaces for DHCP servers
* Received 300 bytes from eth0:192.168.2.1
Offered IP address: 192.168.2.223
DHCP options:
Message type: DHCPOFFER (2)
dns-server: 192.168.2.106
router: 192.168.2.1
Together, this would suggest that you've perhaps manually configured your aforementioned machine to use your router as DNS. Or that machine did not renew its DHCP lease yet to receive the updated DNS server information.
Revert your manual changes on that machine and/or get it to acquire a new DHCP lease from your router's DHCP server.
A few remarks, not directly related to your observation:
Conditional Forwarding is not required when you are using your router as Pi-hole's only upstream. All DNS requests will go through your router anyway. Just make sure you've unticked Never forward non-FQDN and also Never forward reverse lookups for private IP ranges in that setup.
By creating DNS records for the .local TLD, you are interfering with mDNS.
Note that the .local TLD is reserved for mDNS usage and should NOT be used with plain DNS.
However, what irritates me is that still the entered local DNS adresses are not working:
Even more irritating is that I would have guessed that my computer's / phones IP address would appear in the list of network which is not the case at the moment:
Let's focus on your missing resolution of your local domain records first.
What's the output of the following command:
nslookup raspberry.pi
Also, please monitor your Pi-hole's /var/log/pihole/pihole.log when running that lookup, e.g. via pihole -t from a separate terminal window or via Tools|Tail pihole.log.
Please share the respective output and log lines.
While I can now reach the site on the raspberry in the browser, the DNS resolution is not working on other devices within the network. For example from my windows machine, it looks like the pi is recognized as DNS resolver (Address is correct) but not reached
Server: UnKnown
Address: 192.168.2.106
*** No internal type for both IPv4 and IPv6 Addresses (A+AAAA) records available for raspberry.lan
Server: UnKnown
Address: 192.168.2.106
*** UnKnown can't find raspberry.pi: Non-existent domain
On Windows, the first line in the output would normally read Server: pi.hole.
As it's not, and as we've already confirmed that your Pi-hole replies correctly if it receives a DNS request for a known local name, that may hint at something redirecting DNS traffic.
What's the output of
nslookup flurry.com
nslookup flurry.com 192.168.2.106
And please monitor your pihole.log this time.
Do you see the corresponding requests registering in Pi-hole?
Hmm, 0.0.0.0 is the expected reply if a default Pi-hole would have answered the request, as that domain is on Pi-hole's default blocklist, so I'm not entirely sure if this is a redirection.
Common suspects for local DNS redirection would be your router or a client-side anti-virus package. You wouldn't run a package with a respective DNS feature enabled, e.g. AVG Secure DNS or AVAST Real-Site?
For the benefit of other users with a similar issue, could you disclose your router's make and model and perhaps include that in your topic's title?
You'd make it easier to find your solution that way.