I believe the issue resides with the way the OS is resuming (while I can't replicate that, I do believe it's OS related as pi-hole seems to work properly).
Maybe it has something to do with the DHCP lease ?
What happens if you specify the DNS IP manually on your WiFi settings on your Mac (for testing purposes)?
Does it do the same when it comes back from sleep ?
Hello, thank you for your tip. I’ll try that once it happens again. I haven’t noticed this behavior before using pihole, hence this post. I will post here.
Hello - it happened again today, when I manually replaced the DNS server for pi-hole, internet started working fine. So my guess is either the laptop itself, or the Unifi UDM router, which is known to have some bugs in its current firmware. Thanks.
Thank you for your suggestion, but I'd rather not delete all my saved networks along with their passwords. Also, I've noted that if I disable/enable WiFi, it works fine.
You could (again, for testing purposes) use Pi-hole as your DHCP server and see if that addresses the issue.
I believe the logic behind the error is as follows:
Laptop goes in sleep mode with (working) lease from DHCP server. Laptop stays in sleep while lease expired. When laptop is woken up, something is broken between the two (router and laptop) maybe laptop requests new lease and router does not issue due to ... something.
Or, router refuses (or errors out) at DHCP renew ?
When you enable/disable wifi you are basically performing a release/renew ...
@michael_n No problem, it's just a suggestion. I spend a bit of time over at the Apple Support Communities, especially in the networking area, and see this over there, so it's not unique. What I provided you was what has "solved" it for a number of other users having a similar network Internet connectivity problems when their Macs wakeup from sleep mode.
Thank you for your great insights. It is very much possible. I've checked DHCP lease time, and it's set to 24hrs. For the love of God I am not able to find exact time of lease expiration anywhere, in the router console or the client.
Ofc I have absolutely no idea what is happening during sleep/wakeup in Apple ecosystem, but I think the computer is still online, even though in "powersave" mode only ( I can see a green leaf next to the Macbook in the Clients area of the Unifi controller list).
I'll try the DHCP test, and let you know. However, I very much appreciate your insights and replies.
I've observed the following behavior - I wake up the laptop from sleep: no internet. I change the DNS to pihole, internet works. I change it back to router (with pihole as its dns server configured) - internet works.
Hello, this happens only after extended period of time, i.e. overnight.
This morning I have experienced whole pi/pi-hole to be unresponsive and had to reboot it two times, however, the internet was working fine, even though the pihole is the only DNS in the router (?)
I have noticed in the syslog that the raspbian was doing some sort of nightly php cleanup/maintenance starting from around the midnight and wifi signal was lost around 3:00pm ?
/var/log/syslog
Feb 5 03:01:06 r-pi dhcpcd[620]: wlan0: carrier lost
/var/log/messages
Feb 4 00:31:36 r-pi kernel: [ 88.450147] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Feb 4 02:44:02 r-pi kernel: [ 4391.378080] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neig$
Feb 5 00:00:45 r-pi rsyslogd: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="365" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Feb 5 08:37:53 r-pi kernel: [ 0.000000] Booting Linux on physical CPU 0x0
It is currently connected via wifi. Do you think it might be more reliable to connect pi through ethernet? Or, might be the problem related to the fact that I had IPv6 enabled during pihole setup ?
Can I also re-upload pihole diag log link somehow ?
The fact that it was resolving even with Pi-hole removed from the equation, tells me that something else IS resolving for you.
It could be IPV6 or it could be that the router takes over via internal settings ...
Never the less, i personally prefer a hardwired connection but i did run two separate instances of Pi-hole on Raspberry Pi Zero W for about a year without any issues.
I think something else is happening there and maybe it has to do with the router.
Hi,
After moving the pi onto ethernet, all issues disappeared. Also, interestingly enough, Wi-Fi Tx/Rx on the pi always maxed out at 135/200Mbps even on 5GHz.