Strange DNS/Pi-hole/Network issue
Discussion
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?
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?
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)
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)
When you're having the issues, try the following from a DOS prompt:
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.
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
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: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
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
There’s a thread about whitelisting certain domains in pihole that may help
SSH in to the PiHole and run the below
From pihole userspace
SSH in to the PiHole and run the below
pihole -w www.msftncsi.com
From pihole userspace
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


