Strange DNS/Pi-hole/Network issue
Strange DNS/Pi-hole/Network issue
Author
Discussion

mebe

Original Poster:

292 posts

174 months

Thursday 5th July 2018
quotequote all
I have Pi-hole setup to act as my DNS - my router is configured to return the address of the Pi as the DNS for clients. Everything works fine for all devices on the network, no issues whatsoever - until I power cycle the router and Pi.

After a power cycle all clients are happy except one - the laptop I use. After the recycle windows thinks it has no internet connectivity and web browsers fail to resolve domain names.

Looking in a bit more detail:
ipconfig shows the correct DNS address
I can ping and tracert the Pi-hole with no issues
I can VNC into the Pi-hole
nslookup times out although it knows the Pi-hole address
Waiting does not clear the problem

I can resolve this situation in only one way - by opening a browser window to the admin console (I'm logged out but that doesnt seem to matter) of the Pi-hole as in 192.198.1.15/admin which opens correctly. From the moment I do this everything is fine.

I'm a bit baffled. Anyone have any thoughts?

Mr Happy

5,910 posts

251 months

Thursday 5th July 2018
quotequote all
Do you shut down the pihole (sudo shutdown now) or just pull the plug?

For the dhcp clients, do they get the pihole as their DNS only, or is the pihole primary and others secondary (thinking this might explain how some clients work and some don't, if the ones that don't work are configured for primary dns only)

If you do tail -f /var/log/pihole.log from a ssh session to the pihole, do you see any queries being presented if it's in the failed state? (use ctrl+c to exit from the tail command)

mebe

Original Poster:

292 posts

174 months

Friday 6th July 2018
quotequote all
I've noticed it only after a power loss type scenario, guess I should try a clean shutdown.

DHCP clients only get the Pi as primary DNS, no secondary.

Good idea about the log, I will try it.

ging84

9,548 posts

177 months

Friday 6th July 2018
quotequote all
some devices don't play well only being given a single dns resolver, might be worth giving the dns server a second IP and pushing out both addresses

TonyRPH

13,555 posts

199 months

Saturday 7th July 2018
quotequote all
When you're having the issues, try the following from a DOS prompt:


nslookup www.google.com 192.198.1.15*

nslookup www.google.com 8.8.8.8


Both should return an instant response. (should return several addresses)

C:\Users\tony>nslookup www.google.com 8.8.8.8
Server: google-public-dns-a.google.com <<<< note that Windows has obtained the resolver's hostname.**
Address: 8.8.8.8
<snip>

I suspect that your pi-hole doesn't have RDNS set, and this can sometimes upset windows, as it tries to get the resolver host name. (see above)

To circumvent this you could try putting the address and hostname of the pi-hole in your hosts file, or simply just setup rdns for it.

  • this assumes 192.198.1.15 is the IP of your pi-hole

outnumbered

4,901 posts

265 months

Sunday 8th July 2018
quotequote all
What version of Windows? Win7 certainly had some issues with this sort of scenario.

mebe

Original Poster:

292 posts

174 months

Sunday 8th July 2018
quotequote all
It's Win 10

I'm on BT so any attempt to use google as the DNS fails - for some unknown reason they only allow you to use their DNS.

Some good other suggestions to try though ... thanks

TonyRPH

13,555 posts

199 months

Sunday 8th July 2018
quotequote all
mebe said:
It's Win 10

I'm on BT so any attempt to use google as the DNS fails - for some unknown reason they only allow you to use their DNS.

Some good other suggestions to try though ... thanks
In that case just try:

nslookup www.google.com <ip of BT DNS> (should be in your router)

The pi-hole will also need to use this address as a forwarder if they are blocking DNS queries to other servers.

Also try queries against OpenDNS

nslookup www.google.com 208.67.222.222

or

nslookup www.google.com 208.67.220.220

Edit: Reading back through your OP, and with the info provided above - I suspect your PC thinks it's offline, because the pi-hole is not returning any DNS answers (due to BT blocking) hence needing to use BT DNS IP(s) as a forwarder(s).

This is how Windows determines the network status, by DNS queries to the internet - if no suitable response is received, it thinks it's offline - however you can still ping stuff by IP address.

Edited by TonyRPH on Sunday 8th July 17:27

RoadRailer

599 posts

259 months

Tuesday 10th July 2018
quotequote all
There’s a thread about whitelisting certain domains in pihole that may help

SSH in to the PiHole and run the below

pihole -w www.msftncsi.com


From pihole userspace