Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    A fix if you want to use System_Patches package

    Scheduled Pinned Locked Moved DHCP and DNS
    4 Posts 3 Posters 318 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jmedin1965
      last edited by

      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:

      1. install the "System_Patches" package
      2. navigate to System>>Patches
      3. 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.

      GertjanG J 2 Replies Last reply Reply Quote 0
      • GertjanG
        Gertjan @jmedin1965
        last edited by

        @jmedin1965

        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 :

        13be9030-024c-437d-ae36-abb496429422-image.png

        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

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        J 1 Reply Last reply Reply Quote 0
        • J
          jmedin1965 @Gertjan
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • J
            jibagast @jmedin1965
            last edited by

            @jmedin1965

            Thank so much this has solved my issue!!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.