Pi-Hole and internet erratic

This was a very standard install done with the curl command. I chose WiFi rather than Ethernet. The point is to reduce advertising on the streaming TV stick I use - FireStick. Installed nothing optional - not changing sudoers, not ssh, nothing. The only change was to install gufw, then realized it might be a mistake and purged it.

Expected Behaviour:

From my limited past experience I would have blocked hundreds of sites by this time and would have been able to reach the internet from the head unit.

Actual Behaviour:

Raspberry Pi 3b+ and current Raspian. All settings took place on my Peplink Balance 20X router and the TV - nothing on any other computer. I set a Static IP in my router's Network tab, and "tagged" it as a DHCP Reservation in the router's Client list. I rebooted the Pi-Hole. Then I rebooted the TV and it then had the static address as its DNS address. One of 16 blocked examples is example blocked by Gravity is "A malt-house.sbs." Another is "AAAA wklapompy.pl." When the system is connected and I get these blocked queries, I can't connect to the internet, for instance duckduckgo.com. I also cannot complete a debug log when connected. This one was completed when the system was not in use, i.e., I let the router choose its own DNS and not a static address. The WiFi data in the upper right of the screen indicates that WiFi is working and on the proper VLAN and with the proper static IP. When set up with the "Assign DNS server automatically" is NOT checked, the streaming TV device appears to be working properly, and if I leave the proper settings and shutdown the RPi the streaming FireStick stops working as it's supposed to. I'm running the RPi hardware from a nearby desktop with an HDMI cable.

Debug Token:

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

The log shows that the wifi interface has an IP address, but that Pi-hole has been configured to use the ethernet interface which does not have an IP address, so Pi-hole is unable to communicate.

To fix this you'll use your HDMI cable and keyboard. First ensure the Pi has a static IP, either manually or via DHCP assignment, and using whichever interface you're going to go with. It sounds like this part is already sorted but just check.

Then run

pihole -r

and select Reconfigure when prompted. You'll be prompted for the interface to use; make sure to use the one that is configured with the static IP. Follow the prompts and you should be up and running. Do some tests and see if it's working and blocking things.

By all means then create another debug log and I'll take a second look.

You may find it useful to enable SSH so you don't need to pull out the display and keyboard. You can do that with

sudo raspi-config

and then enable it in Interface Options > SSH.

1 Like

Seems to be working - thank you very much. Current debug log is: https://tricorder.pi-hole.net/AO2CLXXo/. (Can't paste from here - the character between the A and C might be either a zero or a capital O. I chose zero, above.)

[ Edit - debug log link fixed ]

I learned a few things. My TV will not turn off when I turn off Pi-Hole - it simply chooses a new IP. I discovered something else useful I should have already known - I cannot simply change Ethernet or WiFi on the fly - I must reconfigure. I have been mixing them as a way to have two separate approaches - Ethernet and WiFi. Also, the best time to set the static IP is when the Pi-Hole installer says, "If you haven't already set a static IP, do it now." If I set it then that's the IP the installer chooses and for multiple installs I won't have multiple static IPs littering the router.

Again, thanks.

The new debug log shows the same situation – the Pi is connected via wifi, which has an address, but Pi-hole has been configured to use ethernet, which does not. You should reconfigure and select the wifi interface when prompted so Pi-hole knows to use that.

*** [ DIAGNOSING ]: Networking
[✗] No IPv4 address(es) found on the eth0 interface.

[✗] No IPv6 address(es) found on the eth0 interface.

[i] Default IPv4 gateway(s):
[i] Default IPv6 gateway(s):

It was working but I agree it's stopped working. I suspect it has to do with my having used for this WiFi approach a static IP that I previously tried with Ethernet. It's the same MAC address, of course, and I can't seem to get rid of the reservation, even reinstalling RPi and Pi-Hole, which I did.

Since we know that static IP is Ethernet, I'll wipe everything and try setting it up Ethernet. f that doesn't work I'll wipe it again and set a new static IP. The problem is I will have two entries in Clients on my router with the same Mac Address and I can't get rid of it. I'll let you know. Thanks. I definitely configured Pi-Hole as wifi.

Before starting over I reconfigured as you suggested. Debug log says: "IPv4 addresses bound to the wlan0 interface: (static IP)/24". I'll see what happens for awhile. This time in re-configuring I used the cursor...

I'm trying it again, with a different static IP and DNS, using Ethernet. Diagnosing now reads, "IPv4 address(es) now bound to the eth0 interface" and the correct IP/24.

72 queries blocked, such as "A www.2ot.sjtl.lat pi-hole Blocked (gravity)". Appears to be working, if slow to open DuckDuckGo.

Can't even open discourse.pi-hole.net on the RPi, so I'm handwriting the bug token: https://tricorder.pi-hole.net/5SvrXJR4/

To close this thread out, Pi-Hole is working. I used Ethernet and a static IP/DNS I haven't used previously. I suspect re-using previously used static IP/DNS was a part of my problem. Pi-Hole is using one particular port on my router (Peplink Balance 20X) by binding it to the Virtual LAN (VLAN) and changing the Ethernet port from "Trunk" to "Access." I think this Pi-Hole recommended approach - to make all configuration changes to the router - is superior to making changes on your personal computer. Thanks - I appreciate the help.

Thanks for the new log, that all looks much better. Pi-hole is now configured to use ethernet and has an IP address. The log shows that it's blocking blocked domains correctly and can reach the rest of the network and out to the Internet.

The router is the DHCP server and is correctly giving out the Pi-hole IP to clients to use as their DNS. So you should be seeing activity now in the Query Log when you refresh it, and you'll see numbers and stats on the Dashboard. What are your thoughts on it now, how's it working for you?

I agree – if you make changes on your router in the DHCP section, then all clients connecting to your network will pick up those settings. Setting manually works, but you'd have to configure every client, and that's what DHCP is meant to avoid.

Thanks, and thanks for asking. I do have a few thoughts.

There's more to a MAC address than the visible paired characters. I think my concerns (and multiple re-flashing and re-configuring) was based upon re-using static IP/DNS numbers. I believe newbies should be encouraged to allow the Pi-Hole installer to pick the static IP rather than choosing one before the installer tells you "this is your last chance." Then select it, wherever it is in your router and click whatever makes it static - in my case it added the MAC and IP to the DHCP Reservation. It's better to let the system choose it than try to force it, if I'm right about the differences between eth0 and wifi0 static IPs.

I believe the RPI Imager was part of my problem. It asked for a WiFi password and didn't mention that if I did not enter a password it would use an existing Ethernet. Possibly, Pi-Hole picked up this implicit WiFi request, even when I selected eth0, but I certainly switched back and forth with the same IP/DNS without re-configuring, and that's on me.

The last time I used Pi-Hole four years ago I understood the setup well enough to write up an instruction piece in my router's knowledge base, so I certainly didn't expect the kind of trouble I ran into this time. In any case, I appreciate your and the forum's patience.

1 Like

Thankyou for those observations, that's useful to other users who are finding some friction at that stage.

Pi-hole used to handle the IP addressing during installation, and that did make things easier, but, paradoxically, it also made things harder. That's because as Linux developed, there were more and more varied ways of managing the networking, and those services and Pi-hole's installer would end up treading on each other's toes. It became quite awkward to unpick what was going on for any given install.

In the end I think the decision was made to just let the Pi-hole installer handle the Pi-hole installation, and simply advise that the install needs a static IP, and let whatever OS tools are in place handle that aspect. That said, I believe that if the older tools are still in use during an install, Pi-hole will detect that and still provide an interface to set up the addressing.

Debian 12, and recent Pi OS, which is based on that, now use Network Manager to handle the networking. There's a handy text user interface which can be invoked with sudo nmtui, and that makes it quite straightforward to set up the addressing. I always run that first, get the IP address in place, and then install Pi-hole. And that makes the Pi-hole install much easier too, because you just select the interface that you just set up, and it's already configured, ready to go.

Good point about the RPi Imager. If you don't enable wifi in there, the wifi interface is offline, disabled with a tool called rfkill. If you do enable it, it's up and running and available for apps to detect and try and use, even if the connection has now switched to ethernet.

The best bet is to decide up front how this is going to be connected (wifi or ethernet) and how it's going to obtain its static IP address (manually or via DHCP reservation), then connect it and configure the IP accordingly. Test that it's reachable and then install Pi-hole onto it, and tell the installer which interface to use. I find that sort of 'forensic' approach is the most reliable because each step builds on a solid previous step.

That is a fine approach. I suppose I was instruction-blind and didn't think to set up the static IP and VLAN binding with RPi before installing the Pi-Hole. Having one variable is always easier. I'm modifying my notes, after working a bit with nmtui. Excellent!

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