The issue I am facing: Randomly, for the past couple of months, we'll lose internet connection. I check the pihole status, and usually it shows online, no overheating, no insane load—everything looks good. I check my router and it doesn't show internet connection, even though it's still broadcasting the wireless signal (I can still ssh into the pi, etc., just can't get out to the internet). I check the modem and can run a speediest directly on it, and no problem—full 1GB up/down. If I reboot the pi, that fixes things instantly. I can't see anything in the logs or otherwise figure out why the router would stop getting internet.
Details about my system: I have an AT&T fiber modem with an IP passthrough to the Orbi mesh router, and have the pihole as the DHCP server.
What I have changed since installing Pi-hole: Nothing. When the problem first started up, I bought a new memory card, made sure the pi wasn't overheating, reinstalled Raspbian and pihole fresh, etc. Even had the AT&T folks come out and make sure it wasn't the modem (at the time I wasn't sure it was the pi). Thought things were solved, but every couple of days the internet still just stops, and when I reset the pi, everything works again. It seems random and nothing I can do reproduces the issue; it seems arbitrary.
Not sure which logs would be most helpful to see, but please let me know what you think might help me to diagnose, and I'll be sure to grab logs/etc. the next time it goes down (if that makes sense). Thanks!
Running Pi-hole 5.10, AdminLTE 5.12, and FTL 5.15. Raspbian 11 (bullseye) on a pi 3 model B.
Possibly unrelated, but I also noticed this morning that I had slightly fewer than a bajillion diagnostic messages, all pretty much saying the same thing:
not giving name raspberrypi.lan to the DHCP lease of 192.168.2.105 because the name exists in /etc/hosts with address 127.0.1.1
I investigated and .105 was . . . the Raspberry pi itself! (dun dun dun) It appeared it was connecting via wifi and then trying to talk to itself? I disabled wifi on the Pi (manually, then via rfkill, then by adding in dtoverlay=disable-wifi in config.txt and rebooting), and confirmed that the router no longer sees the .105 address connected, but somehow I'm still getting the diagnostic error.
Please note that I haven't had the intermittent complete failure to connect to the internet as I was originally mentioning; it hasn't happened since my original post. So I share this just in case it's related, or in case there's an easy solution to this issue (which isn't causing any functional problem other than filling up my diagnostics screen) while we ponder the random complete failure to get internet.
@DanSchaper A quick update: the internet hasn't randomly stopped again since I've posted, but I continue to get the "not giving name" message I posted above. I'll do a search for that issue in more detail, but just wondering if you saw anything in the logs.
That warning already has the details:
A DHCP client at 192.168.2.105 is trying to register a name of raspberrypi.lan, but that is also the name of the machine that runs Pi-hole (seems you have two RPis running on your network?).
To avoid that conflict, rename 192.168.2.105, e.g. you could use sudo raspi-config on that RPi to do so (presumably located under Network Options | Hostname).
Hmm, interesting. I do not have two Rpis on the network, so the plot thickens.
I don’t know if this helps, but when I first started having these random internet issues, I bought a new microSD card, reinstalled Raspbian, reinstalled/configured pi-hole, etc., hoping to resolve things. I also run octoprint on docker.
Is there some reason the system sees another rpi even though I only have one? (I actually did just buy another one to set up some kind of backup DNS/monitoring system failsafe, but it hasn’t even arrived yet, so unless my current Pi is living in the future, not sure why it thinks that.)
** server can't find 105.2.168.192.in-addr.arpa: NXDOMAIN
(Is it supposed to show up backwards like that?)
In any case, I decided to look up 192.168.2.105 in the network list in the pihole, and found that the address was to pihole, and had last sent a query on 4/24. "Uses pihole" showed a question mark, so I deleted it. That didn't fix things, the diagnostic still kept reporting, so then your question made me think, "nothing should be using wlan, so let's look that up". I did, and lo and behold pihole was also showing up on wlan (with an ipv6 address), and the same stats as .105 in terms of query, using pihole, etc. So I deleted that, too, and now it seems the error messages have stopped.
Thanks!
The weird thing is, my pi was never set to .105 (AFAIK), but maybe I did something weird when I configured the system and then changed it to my usual IP later and the system still kept looking for the device . . . I don't know.
In any case, that's resolved, so I guess the only other issue is, is there anything in my system that might explain the random internet fails, even though the pi is running and pihole still thinks everything is OK (and everything is OK with the modem/router, end devices just can't get out to the internet)?
It hasn't happened again since I posted, but still curious if anyone has ideas. Thanks!
Update update: deleting the entries from the pihole did not actually resolve the error messages. I had to go into /etc/hosts and delete out the entry at 127.0.1.1 with the name raspberrypi. Doing so and restarting the DNS server has seemed to put an end to the diagnostic error messages without any (that I can perceive) side effects.
As for the entries from your Pi-hole's Network overview:
(emphasis mine)
That entry wasn't related to your observation, as pihole is not the same name as raspberrypi.lan.
And as entries in Pi-hole's Network overview are informational, deleting entries from it won't have an impact on that DHCP warning you are observing. That is caused by two two hosts claiming the same name.
However, the fact that a wlanInterface showed up in your Pi-hole's Network overview would confirm that your RPi has been connected to your network via wifi at some stage. (Your debug log (which has expired by now) did not show your RPi'swlan0interface to be active anymore, onlyeth0.)
So you have somewhat applied my advice, but only partiall, and not to the .105 machine as recommended:
Editing /etc/hosts would only have taken care of a portion of DNS records in your Pi-hole (as that 127.0.1.1 entry was only for the loopback address). It likely won't have renamed your RPi consistently, which would still consider raspberrypi as its legit name, as e.g. shown by hostnamectl or hostname. This may also lead to name collisions in your network with other naming services like mDNS.
While removing raspberrypi from /etc/hosts on your RPi may now have allowed 192.168.2.105 to claim raspberrypi as a name, you still do not know what that device is, or if it would be active on your network.
I'd recommend to find out about 192.168.2.105 first before applying any changes.
Sorry, I thought I did answer your question. Is this not what you were asking? The 192.168.2.105 address was also my raspberry pi, but vía the wifi (wlan). Once I turned off the wifi, pinging 192.168.2.105 does nothing (returns request timeout for icmp_seq ##).
I appreciate your thoughts on this—especially as I’ve just been half-blindly guessing at what’s going on. Do you think I need to turn the wifi back on and add the entry in /hosts again? Is the concern there’s a rogue device on the network?
You didn't answer me directly, but still it's my turn to apologise - I didn't catch that previous statement of yours about you disabling the wifi connection.
In that case, your Pi-hole may still hold on to a previous DHCP lease for that .105 when your wifi was still active, which it may keep renewing as that client's associated MAC address would still show up on the eth0 link.
Please check:
grep -c raspberrypi /etc/pihole/dhcp.leases
grep -c 192.168.2.105 /etc/pihole/dhcp.leases
If that returns a count of 1 or more, please try:
sudo systemctl stop pihole-FTL.service
sudo nano /etc/pihole/dhcp.leases
Delete the line(s) containing the name and IP address.
Thanks! I performed those steps (got a few error messages when I tried to nano after stopping FTL, and then the same message when I finally did get in and then tried to start FTL again), and now when I run grep it shows zero instead of one.
Thanks again for your help! Even though this ended up being a different thread than I had originally intended, maybe this was all related to our intermittent loss of internet, so I'm going to mark this as the solution (I probably should have opened a new thread for my diagnostic error; my bad). If we get the weird internet/pihole drop error again, I'll . . . What should I do? Open a new thread? Resurrect this one?