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

    DHCP DNS hostname cache

    Scheduled Pinned Locked Moved DHCP and DNS
    4 Posts 2 Posters 1.1k 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.
    • D
      digital_janitor
      last edited by

      My question is in regards to the "Register DHCP static mappings in DNS forwarder".

      Everything is working as desired, in that my local network hosts are registering, and can be resolved forward and backwards just how I want.  However the names seem to age off when the device is turned off for some amount of time.  For example, my smart TV shows up as LGsmartTV when on, and I can do an nslookup on its name forward and reverse.  However the next day I can see the lease is still in the DHCP cache, but the hostname is blank.  If I turn the TV back on, it re-ACKS and populates.

      Is there a setting or a TTL on that hostname associated with a lease?  I wish for the name to persist for several days in the local DNS.

      Thanks!

      1 Reply Last reply Reply Quote 0
      • JKnottJ
        JKnott
        last edited by

        Yes, it's that DHCP Static Mappings for this Interface on the DHCP server tab.  You assign an IP address to a MAC address and then assign a host name to it.  You could also separate that by using the DCHP server tab to assign an IP address and then on the Forwarder or Resolver tab, creating a separate entry for the DNS to IP mapping.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        1 Reply Last reply Reply Quote 0
        • D
          digital_janitor
          last edited by

          Thank you for your reply, I must not have been clear enough.  I am referring to the way the DHCP server and DNS work together.

          Lan client grabs DHCP lease from pfsense.  PFsense registers the client name in DNS.  If you look at DHCP leases you can see the IP address, mac address, and hostname.  You can perform an nslookup against the pfsense DNS and get return of both A and PTR.  You turn off the LAN client.  You can still see the ip, mac, and hostname, you can still perform an nslookup.  At some point the hostname gets stripped from the stale DHCP lease.

          I know I can add a static mapping, but I'd prefer to not to maintain it in that fashion.

          This setting is working:
          DHCP Registration
          Register DHCP leases in DNS forwarder If this option is set, then machines that specify their hostname when requesting a DHCP lease will be registered in the DNS forwarder, so that their name can be resolved. The domain in System: General Setup should also be set to the proper value.

          The hostname just gets stale and drops out of DNS if the host is turned off for something like 12 hours. (I'm guessing I'm not sure exactly how much time has to pass.)

          1 Reply Last reply Reply Quote 0
          • D
            digital_janitor
            last edited by

            I am going to try and increase the lease time on DHCP, found it was set to 2 hours.

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