This is a bit tricky as I'm not certain what is going on. In short, the pihole works for a few hours then stops providing internet. Sometimes, after anything from a few minutes to a few hours, it will start working again, as if nothing had gone wrong.
When it is not working a device generally cannot get an IP address (and therefore no internet). If you have a connection already it comes up with internet pages not available. If I check the pi zero it generally starts working again (but not always). I ran the debug when there was no internet connection but it seems to have come back online whilst the log was running.
I originally thought it was a power issue but now have a 2A plug connected; it seemed to work for about 24 hours then had the same issue. I have also turned off power management on WiFi.
Once a device has an IP address it won't try to get another one until the lease is nearly up. So, you shouldn't expect your clients to be getting IP addresses very frequently.
Are you referring to "can't get a domain name resolved to an IP address" instead?
Any device trying to connect to the WiFi network attempts to get an IP address but gives up after trying for a while. My lease length is quite short so this does happen fairly often.
If I give a manual IP and DNS then the device does connect and has internet access.
That debug log still looks fine, except perhaps that FTL (and therefore dnsmasq) was not shown to be using ports 67 and 68, which it should be using for DHCP. Can you check if these ports are using by pihole-FTL when it is working and when it isn't? Use sudo netstat -tulpn
The internet went down today while I was using it. The webpage came back with a DNS error - could not resolve DNS. I turned on the monitor for the raspberry pi but as soon as I started typing to run the debug it came back online again. Could it be something do to with a setting where it goes to sleep?
I ran pihole-FTL and it comes back with the message "dnsmasq: failed ot bind DHCP server socket: Address already in use"
I have changed the power supply a couple of times because I thought it might have been that. I've now got a 2A (apparently) USB plug.
I misread your message and ran the command pihole-FTL! That might be why the result was a bit strange. I ran it later and it came back with a success message.
I also ran (another) debug log and I noticed there was an error with the gateway. The debug log is kiq7fncjd7
I took it first thing this morning.
Only interact with FTL via service commands, such as sudo service pihole-FTL restart. You should probably restart your system, as FTL is now running under root instead of pihole, and other things may be awry.
Make sure you are able to reach the internet over the interface you configured Pi-hole to use, which in your case is wlan0 (wifi).
Restarted, no problem connecting to the internet (although it had dropped out in the last 24 hours at least once) and I've changed the power plug to be a 1.8A 5.2V Amazon plug now.
I'll try to get the FTL ports when I can. Anything else that you can see which is not looking right?
:-(
Shame! Do you think my 1.8A Amazon charger could be causing the problems?
I may do a complete wipe and start again in case there's something else I've installed interfering with it, although I only have unbound (not in use) and openvpn installed!
I wanted to post my answer for others to see:
The power plug worked for a little bit but then I started having the same issues again. I did a complete wipe and installed the light version of raspbian. This is now been running flawlessly for over a month. Still using my 1.9 amp plug. It seems the pi zero with all the other raspbian bits was just not powerful enough.