Confused DNS resolving?

Hello I'm new in the forum =) I'm from Spain and sorry for my English.

I have a doubt about how Pi-hole works. Actually I'm runnig Pi-hole in my raspberry, and I configured my Raspberry's IP address as DNS on my smartphone (Android).

Pi-hole seems to be working fine in my smartphone, blocks ads on websites, It's Ok. But when I run in console (Termux App in my smartphone) the command: "dig anywebsite.com" to see what DNS my smartphone is using the result say that the DNS server in use is SERVER: 8.8.8.8#53(8.8.8.8) Google's DNS I know.

What is the reason? Maybe something escapes me for understand what is happenig.

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

Welcome to the forum, and your English is fine (much better than my Spanish :grinning:).

Your debug log shows that your Pi-hole is working normally.

The terminal command from the client smartphone does appear to show that that request went to a Google server. Run these two commands from the Termux app on the phone and post the results:

nslookup pi.hole

nslookup pi.hole 192.168.0.173

1 Like

Hello jfb and thank you for answer :slight_smile:

Ok, the fist command shows this:

nslookup pi.hole
Server: 8.8.8.8
Address: 8.8.8.8#53

** Server can't find pi.hole: NXDOMAIN

The second command shows this:

nslookup pi.hole 192.168.0.173
Server: 172.168.0.173
Address: 192.168.0.173#53

Name: pi.hole
Address: 192.168.0.173

That is all.

PS: I don't know if this is helpful, but if I access to https://www.dnsleaktest.com/ and I run the standard test the result says this:
IP Hostname ISP Country
188.114.. None Cloudflare Spain

That client is not using Pi-hole for DNS. The first nslookup went to the designated DNS server (which is a Google DNS server). The second forced the command to go to Pi-hole, which received the request and returned the correct answer.

I would look on a forum for your model phone and OS for a solution on how to assign DNS on that device.

1 Like

Thank you again jfb. I will search, but I thought that was enough with change DNS address in "Advanced Options" in my Wifi configuration in my smarthphone, that is a S10+

But I am surprised that on my smartphone, the websites do not show ads, and in the Pi-hole web panel it appears as a client.

Thank you again :slight_smile: I will search and if I find the solution I will said here!

It appears the Termux shell is default configured to use 8.8.8.8 and bypassing Android DNS settings:

You used to be able to lookup DNS servers with the getprop command but not anymore after latest Android update ... at least for me.

2 Likes

This would explain why no ads are seen on the phone and it is a Pi-hole client in the Pi-hole web UI.

Yup, you have to do weird things now to check DNS servers configured like set a static IP and DNS but dont apply.
When go this path, Android will auto fill these DNS settings received via DHCP in the static configuration screen.
Or install a network app.

1 Like

Hi again, and nice to meet you too eHakkelaar =)

So eHakkelaar you say that Termux bypasses the DNS that I have set on my smartphone, OK I understand a little, on the other hand, if I use the command you mention"getprop" in Termux, I see a very long list but I don't anything about DNS references.

This would explain why no ads are seen on the phone and it is a Pi-hole client in the Pi-hole web UI.

Does it mean that I managed to configure everything correctly?

Sorry for bombing questions :sweat_smile: I want learn. Thanks for yours answers.

EDIT:

:I use the command you mention"getprop" in Termux, I see a very long list but I don't anything about DNS references.

Sorry I understood I should use that command, and i just understood that it doesn't work to see DNS anymore. All because of my bad English. :sweat_smile:

I think simplest would be to install one of the network info apps to check DNS servers on Android.

Windows got the ipconfig /all command and below one:

netsh interface ip show dnsservers

MacOS got below:

scutil --dns

And Linux clients depends on what network manager is installed.

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