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

    Clearing DNS records created by DHCP

    DHCP and DNS
    4
    12
    2.5k
    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.
    • F
      farhank
      last edited by

      I created a new machine which got an IP address through DHCP. Pfsense is configured to register these to DNS.

      I then gave the new machine a static IP address and added that to DNS then removed the DHCP lease from Pfsense but can't find the DNS record anywhere.

      I get both the new and old IP addresses from nslookup from multiple machines. How can remove the old DNS records created by the DHCP service?

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        Are you sure the old IP address isn't being cached on each client?

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

          @KOM:

          Are you sure the old IP address isn't being cached on each client?

          If it is in the DNS cache, it should be deleted after a period of time.  Regardless, it's possible to flush the cache.

          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
          • F
            farhank
            last edited by

            @KOM:

            Are you sure the old IP address isn't being cached on each client?

            I get the same results from different machines. Including Linux machines which don't have a DNS cache

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              And your using unbound, the forwarder?  What?  Was this client a static dhcp reservation before.. Did you remove the reservation off pfsense?

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.7.2, 24.11

              1 Reply Last reply Reply Quote 0
              • F
                farhank
                last edited by

                @johnpoz:

                And your using unbound, the forwarder?  What?  Was this client a static dhcp reservation before.. Did you remove the reservation off pfsense?

                Using unbound. The old IP address wasn't static, it was assigned by the DHCP server. I removed the DHCP lease. A static mapping wasn't configured

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  Ok look in
                  dhcpleases_entries.conf

                  Or
                  host_entries.conf

                  in /var/unbound do you see this old entry?

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                  1 Reply Last reply Reply Quote 0
                  • F
                    farhank
                    last edited by

                    @johnpoz:

                    Ok look in
                    dhcpleases_entries.conf

                    Or
                    host_entries.conf

                    in /var/unbound do you see this old entry?

                    Yes I can see the old IP address in dhcpleases_entries.conf and the new one in host_entries.conf.

                    1 Reply Last reply Reply Quote 0
                    • johnpozJ
                      johnpoz LAYER 8 Global Moderator
                      last edited by

                      well remove it from dhcpleases._entries.conf

                      You stated you had removed the old lease - if so it should of been removed from there when you did that.

                      An intelligent man is sometimes forced to be drunk to spend time with his fools
                      If you get confused: Listen to the Music Play
                      Please don't Chat/PM me for help, unless mod related
                      SG-4860 24.11 | Lab VMs 2.7.2, 24.11

                      1 Reply Last reply Reply Quote 0
                      • F
                        farhank
                        last edited by

                        @johnpoz:

                        well remove it from dhcpleases._entries.conf

                        You stated you had removed the old lease - if so it should of been removed from there when you did that.

                        I removed it from dhcpleases._entries.conf. Does anything need restarting for the changes to take effect? I still get the old IP from nslookup

                        1 Reply Last reply Reply Quote 0
                        • F
                          farhank
                          last edited by

                          This is working now. Just had to give it some time it seems

                          1 Reply Last reply Reply Quote 0
                          • johnpozJ
                            johnpoz LAYER 8 Global Moderator
                            last edited by

                            well you would need to clear the cache on dns server, and or clients local copy which would time out after the ttl expired which most likely would of been at most 1 hour.

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 24.11 | Lab VMs 2.7.2, 24.11

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