-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pi.hole only works intermittently. #247
Comments
Please see This Project is Dormant. If you really are still using this repo then you should probably consider migrating to SensorsIot/IOTstack. If you are already using SensorsIot and filed this case here on gcgarner by mistake, that's OK. I just wanted to make sure you understood this repo isn't being maintained. Whatever is causing the problem you report probably isn't going to be fixed just by switching to SensorsIot because the service definition for PiHole hasn't changed. When I look at your URL:
I want to ask a few questions. Before I get to my questions, I'd like to set the scene by working through the URL I use on my own instance of PiHole:
In my case, all my computers know that an unqualified name like "pihole" should be treated as being in "mydomain.com". In Linux terms, that's:
So, the URL that actually gets resolved is:
When that fully-qualified domain name gets resolved to an IP address, it's the same as:
The other thing to note is the "8089" in each of my URLs. That comes from the PiHole service definition:
Now my questions:
If your active service definition (the one in If you've re-mapped PiHole to port 80 (nothing wrong with that) then it's whatever process is resolving "pi.hole" to the IP address that is broken. That's what we'll have to drill into. Last point. If your answer to Q1 involves NGINX or anything similar, you really would be better off re-asking this question on SensorsIot and/or joining the Discord channel (link on the main SensorsIot page). I've never seen the need for reverse proxies, so I don't understand or have any experience with them, so I simply can't provide any useful advice. |
I have not got enough knowledge to understand what pi hole's domain name
resolution is doing. I only know that if I make a change to the list of
blocked sites
by adding to the sites on the Group Management->Adlist (sites taken from
"The Big Blocklist Collection" at Firebog.net) the pi.hole domain fails to
connect.
Then, about 2 days later, it recovers and works again. Pi hole is pretty
flaky I guess. I still get ads on my phone. I have to install ad blockers
on all the browsers anyway.
These still report hits at many sites. Including ublock origin. So I am not
sure I really see any benefit in pi hole. I confess it is a disappointment.
Or perhaps there is something wrong with my
installation. However, there are no errors reported on the dashboard.
…On Wed, Aug 10, 2022 at 6:36 PM Phill ***@***.***> wrote:
Please see This Project is Dormant
<#194>.
If you really are still using this repo then you should probably consider
migrating to SensorsIot/IOTstack <https://github.com/SensorsIot/IOTstack>.
If you are already using SensorsIot and filed this case here on gcgarner
by mistake, that's OK. I just wanted to make sure you understood this repo
isn't being maintained.
------------------------------
Whatever is causing the problem you report probably isn't going to be
fixed just by switching to SensorsIot because the service definition for
PiHole hasn't changed.
When I look at your URL:
http://pi.hole/admin
I want to ask a few questions. Before I get to my questions, I'd like to
set the scene by working through the URL I use on my own instance of PiHole:
http://pihole:8089/admin/
In my case, all my computers know that an unqualified name like "pihole"
should be treated as being in "mydomain.com". In Linux terms, that's:
$ grep "search_domains" /etc/resolvconf.conf
search_domains=mydomain.com
So, the URL that actually gets resolved is:
http://pihole.mydomain.com:8089/admin/
When that fully-qualified domain name gets resolved to an IP address, it's
the same as:
http://192.168.132.60:8089/admin/
The other thing to note is the "8089" in each of my URLs. That comes from
the PiHole service definition:
$ grep "8089" ~/IOTstack/.templates/pihole/service.yml
- "8089:80/tcp"
Now my questions:
1. How does "pi.hole" resolve to an IP address on your system?
2. Have you mapped the PiHole container so it responds on port 80?
If your active service definition (the one in docker-compose.yml) is
still expecting port 8089 then I don't understand why you get a response
when you use the IP address in your URL.
If you've re-mapped PiHole to port 80 (nothing wrong with that) then it's
whatever process is resolving "pi.hole" to the IP address that is broken.
That's what we'll have to drill into.
Last point. If your answer to Q1 involves NGINX or anything similar, you
really would be better off re-asking this question on SensorsIot and/or
joining the Discord channel (link on the main SensorsIot page). I've never
seen the need for reverse proxies, so I don't understand or have any
experience with them, so I simply can't provide any useful advice.
—
Reply to this email directly, view it on GitHub
<#247 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AYZYX7X7QKYY7TKXMQG7443VYRKJRANCNFSM56F53DQA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
OK. I can hear your frustration. I have no idea what the problem is but I will try to help. I've been using PiHole for more than 5 years. For the first two years it was running as a dedicated image on a Raspberry Pi 3B+. In late 2019 I started using IOTstack so I've been running PiHole as a container since then. In all that time: zero trouble. Not at all flaky. It just works. Last 24 hours. Lots of blocking activity! Definitely doing its job. My experience doesn't necessarily generalise to your environment. I also have a data-communications background and sometimes things that are obvious to me aren't at all obvious to other people. However, my experience should at least give you comfort that PiHole can work reliably. It might help if I paint a bit of a picture of how everything comes together. That might give you a better chance of figuring out the best place to ask further questions:
I'll make a few observations:
OK. Let's just consider your phone. I'll make some assumptions:
The question is, how does the phone know where to get DNS? Unless your phone has a static configuration (and only you will know that), the first thing it does when it connects to WiFi is issue a DHCP request. In the average home network, your router is also your DHCP server so it will respond with a "lease" which includes an IP address for the phone to use plus one or two IP addresses of the DNS servers the phone should use. In many cases, the IP address of the DNS server in that lease will be the IP address of the router itself. On the WAN side, your ISP plays the same game and hands your router an IP address to use for its WAN interface, plus a couple of IP addresses of the ISP's own DNS servers. So, unless you have changed this arrangement, your phone will send DNS queries to your router and your router will relay those queries to your ISP's DNS servers. Nothing will go through PiHole. It is also reasonably common to change the DNS servers your router hands out in leases to be different to the ones your ISP wants you to use. It's typical to see 8.8.8.8, 8.8.4.4 (both Google) and 1.1.1.1 (Cloudflare). In that situation, your phone will bypass your router's resolver and send its DNS queries direct to whatever DNS servers you've programmed into the router to be handed out in leases (8.8.8.8 etc). But still not from PiHole. There are three ways of forcing your phone to use PiHole for DNS:
I used #3 for many years. These days I use #2. I've never used #1 because of the what-if scenario where the Pi stops working for some reason - everything is kaput. I'd rather have some devices still working! Now I'm going to assume you've picked an approach and you are sure your phone is using the IP address of the Pi running PiHole for DNS. You should test that. First, login to the PiHole admin page (more on this below), then the Query Log tab. Next, do something (anything) on your phone which causes it to issue a DNS query (like browse to a page). Refresh the query log. If you see the expected queries in the log, you'll know PiHole is getting those queries from your phone. Second, you should test blocking. Go to the Blacklist tab and add a nonsense domain like "freddy.noidea.org". Try to resolve that domain in your browser. Don't worry if you still get a response implying that the block hasn't worked. Look at PiHole's Query Log tab and make sure it shows up as "blocked". Once you've proved to yourself that your phone is using PiHole and at least one query coming from your phone has been shown to have been blocked, reboot your phone. That's to clear its DNS cache. Then, see if it is blocking ads as you would expect. In Group Management » Adlists, I see: If I do a clean-slate install, I only see the first one. That should also tell you how little "management" I do on PiHole which, in turn, tells you how little trouble it causes me! I should probably weed out a few of those.
I think you should ignore URLs like that, at least for the moment. You'd be better off with IP addresses. For example, if the Raspberry Pi running PiHole is 192.168.1.10 then:
Why? Well, let's consider
That's a different response to something that doesn't actually exist:
A response of "0.0.0.0" is actually the "blocked" pattern. In TCP/IP, the address 0.0.0.0 means "this host" (or, more precisely, "any interface on this host"). So, when you use a browser to try to resolve that:
it works because the host where I'm running the command is the Pi running PiHole so 0.0.0.0 goes somewhere. But if I try to do that from, say, a phone then the phone is not running anything on port 8089 so the query goes nowhere.
Also notice how I've used
Basically, whatever the Now let's consider the
The point is that unless Hope something in all of this helps. |
Sometimes I can reach the pihole dashboard with http://pi.hole/admin and most times NOT. The static IP address always works. If I add more block lists, it breaks. Restarting does not fix it.
The text was updated successfully, but these errors were encountered: