Solved: Local DNS not working / pihole not working (Ubiquiti- Unifi Dream Router)

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:
grafik

With local DNS forwarding activated:
grafik

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:

pi@raspberrypi:~ $ nslookup raspberry.local
Server:		192.168.2.1
Address:	192.168.2.1#53

** server can't find raspberry.local: NXDOMAIN

Also tried other local DNS entries:

Expected Behaviour:

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?

Debug Token:

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

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.

1 Like

Thanks for the help. Indeed the vlan of the raspberry was not using pihole as a DNS Server.

I have now changed that and the nslookup seems to look better:

 nslookup ronneburg.net
Server:		192.168.2.106
Address:	192.168.2.106#53

However, what irritates me is that still the entered local DNS adresses are not working:

grafik

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:

That is why I initially activated conditional forwarding...

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.

Looks alright

nslookup raspberry.pi
Server:		192.168.2.106
Address:	192.168.2.106#53

Name:	raspberry.pi
Address: 192.168.2.106
nslookup raspberry.lan
Server:		192.168.2.106
Address:	192.168.2.106#53

Name:	raspberry.lan
Address: 192.168.2.106

Yes - and we won't need the log lines with that positive result. :wink:

Where do you observe resolution failures then?

Thanks - and sorry for that :sweat_smile:

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?

1 Like
nslookup flurry.com
Server:  UnKnown
Address:  192.168.2.106                                                                                                                                                                                               Name:    flurry.com
Address:  0.0.0.0

and the second one

Server:  UnKnown
Address:  192.168.2.106                                                                                                                                                                                               Name:    flurry.com
Address:  0.0.0.0 

pihole.log does not change so not reacting at all. Tried it locally on the pihole and the log changed. So you seem to be on the right path... :thinking:

---- EDIT ----
Your redirecting idea made me thinking and I actually found a setting in the router where it said "adblocking" which was enabled :facepalm:

It is in the settings near traffic management.

Deactivating it made it worse, at first. Then I realized, because of the different VLANs, I have to permit all origins.
grafik

Works now and can see the computer in networks tab...

Thanks for your help :+1:

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?

Please see my edit in the last answer. :smiley: Thank you so much. Today I learned something :love_you_gesture:

1 Like

Seems we were typing simultaneously.

Glad you've got it working again. :slight_smile:

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. :wink:

2 Likes

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