A fix if you want to use System_Patches package
-
Re: DHCP lease screen not loading
Looks like at some stage, the DHCP server started adding entries to ./var/dhcpd/var/db/dhcpd.leases file for each DHCP address, weather it's being issued or not. Or else it's been like that always. The php code in /src/etc/inc/system.inc does a hostname lookup for each of these IP addresses. Either way, if you do have a number of leases in this file, the lookup takes forever, so the GUI times out. If you would like that lookup disabled and for the patch to survive an update, just do the following:
- install the "System_Patches" package
- navigate to System>>Patches
- click "Add New Patch"
4) Description: status DHCP hangs
5) URL/Commit ID: leave blank
6) Patch Contents: see attached file dhcp_status.patch
7) Leave other fields as default
8) possibly tick "Auto Apply" if you want or just apply it manually. Your choice here.
Now navigate to "Status>>DHCP Leases" and it loads quick, be it without the results of a dns lookup for each entry.
The other alternative is to manually add a DNS entry for each unassigned IP address in the DHCP ranges.
Hope this helps others.
-
For 24.03, right ?
Strange that this issue still persists, as it was found, located, and solved many moons ago.
Hence the extensive test "is dns avaible ?" check_dnsavailable() just before gethostbyaddr() is called.From the top of my head, when check_dnsavailable() indicated dns is avaible, but gethostbyaddr() takes ages to finish its job, then the dns went away just before gethostbyaddr() got called.
This probably means :is checked, so every incoming lease will restart unbound. if this happens a lot, like : wifi devices that loose the connection often will initiate a DHCP transaction every time the connection comes back. If this happens 10 times a second, then your DNS (unbound) is as good as dead as it is restarting all the time.
The check_dnsavailable() will say : it's avaible, but gethostbyaddr() fails after a long wait.The real solution is coming : as soon as kea is implemented in 24.08 ( ? see netgate latest blog post about kea ) the issue will be gone for good.
Btw : I never had issues showing this page : Status > DHCP Leases because (imho) the unchecked option, and I'm using mostly DHCP MAC static leases for most of my devices. That must be this :
The other alternative is to manually add a DNS entry for each unassigned IP address in the DHCP ranges
-
@Gertjan said in A fix if you want to use System_Patches package:
gethostbyaddr
Hi, thanks for the quick reply. Yes, you are right. I just checked and I had enabled Register DHCP leases but had not waited long enough for it to kick in I'm guessing.
The system_patches package is awesom BTW, I just clicked revert to test and page loaded just fine.
I put the debugg statements back and yes, it's calling gethostbyaddr() for every available lease, not just assigned leases, but just returning the IP address as the hostname and it's super quick now.
Sorry, I have the CE 2.7.2 version. I also suspected that this would probably get fixed when Kea is ready.
Again, really appreciate the quick response.