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

    Dnsmasq alternate db file

    2.1 Snapshot Feedback and Problems - RETIRED
    4
    10
    2.6k
    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.
    • N
      NOYB
      last edited by

      Doing some per interface instance dnsmasq and dhcpleases to support the dhcp server interface specific specified domain option.  Pretty much have it working but lack one critical piece.  Cannot seem to get dnsmasq to use a specified leases db file, such as dhcp.leases.de0 instead of the default dhcp.leases.

      The dhcp-leasefile option does not seem to work.

      Have come across some info that the dhcp-leasefile option is depreciated and will be removed in a future release.  Just guessing that is why it doesn’t work.  Although the option does still exist and does not throw an error or warning.

      Is there a way to make dnsmasq use an alternate db file?

      1 Reply Last reply Reply Quote 0
      • jimpJ
        jimp Rebel Alliance Developer Netgate
        last edited by

        We don't use dnsmasq for DHCP, and it no longer reads the DHCP leases file directly. The dhcpleases daemon watches the leases file in /var/dhcpd/var/db/ and then writes the changes directly to /etc/hosts

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • N
          NOYB
          last edited by

          @jimp:

          We don't use dnsmasq for DHCP, …

          That doesn't seem to jive with what I see in /etc/inc/services.inc.

          @jimp:

          … and it no longer reads the DHCP leases file directly.

          But what writes the DHCP leases file?  That is what I must be missing.

          @jimp:

          The dhcpleases daemon watches the leases file in /var/dhcpd/var/db/ and then writes the changes directly to /etc/hosts

          Yes this I'm aware of and am able to direct interface specific instances of the dhcpleases daemon to an interface specific dhcp.leasees.x db.  That part works fine.

          What I'm trying to do is create interface specific dhcp.leases db's.  How do I do that?
          Code in /ect/inc/services.inc seems to be using dnsmasq.
          If dnsmasq is not being used, then what?

          1 Reply Last reply Reply Quote 0
          • jimpJ
            jimp Rebel Alliance Developer Netgate
            last edited by

            What exactly are you referring to in services.inc that's associating dnsmasq with dhcp?

            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

            Need help fast? Netgate Global Support!

            Do not Chat/PM for help!

            1 Reply Last reply Reply Quote 0
            • W
              wallabybob
              last edited by

              @NOYB:

              If dnsmasq is not being used, then what?

              dhcpd

              1 Reply Last reply Reply Quote 0
              • N
                NOYB
                last edited by

                ~ line 1460 in function services_dnsmasq_configure()

                /* run dnsmasq */

                mwexec_bg("/usr/local/sbin/dnsmasq –local-ttl 1 --all-servers {$dns_rebind} --dns-forward-max=5000 --cache-size=10000 {$args}");

                Is this only used for dns then and dhcpd for dhcp?

                Guess I need to be looking at dhcpd instead.

                Thanks,

                What I'm aiming for is to have dhcp clients registered in dns forwarder (hosts file) with the domain name specified in the dhcp services for each interface.

                Any other tips for going about this?

                1 Reply Last reply Reply Quote 0
                • jimpJ
                  jimp Rebel Alliance Developer Netgate
                  last edited by

                  dnsmasq is for DNS only, isc-dhcpd is for dhcp leasing.

                  The dhcpleases daemon (in the tools repo, in pfPorts) is what monitors the leases file. It reads the data from there, and writes the entries to /etc/hosts.

                  dnsmasq then reads /etc/hosts to provide the DNS responses to clients.

                  I'd guess that dchpleases would need to be taught about the domains if it isn't smart enough to handle them already.

                  Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                  Need help fast? Netgate Global Support!

                  Do not Chat/PM for help!

                  1 Reply Last reply Reply Quote 0
                  • N
                    NOYB
                    last edited by

                    @jimp:

                    dnsmasq is for DNS only, isc-dhcpd is for dhcp leasing.

                    The dhcpleases daemon (in the tools repo, in pfPorts) is what monitors the leases file. It reads the data from there, and writes the entries to /etc/hosts.

                    dnsmasq then reads /etc/hosts to provide the DNS responses to clients.

                    I'd guess that dchpleases would need to be taught about the domains if it isn't smart enough to handle them already.

                    Already have multiple interface specific instances of dhcpleases running and using reading interface specific dhcp leases "db's" and adding the clients in hosts file with the dhcp service specified domain name for that interface.

                    Think I just need to get dhcpd to operate on an interface specific basis (interface specific dhcp leases "db's")
                    Is there a better way to do this?  For instance without running multiple instances of dhcpleases and dhcpd.

                    Thanks

                    1 Reply Last reply Reply Quote 0
                    • jimpJ
                      jimp Rebel Alliance Developer Netgate
                      last edited by

                      I'm not sure it can/will do that.

                      Probably dnsmasq needs to know in a single instance what domain name belongs with what range of IPs and match them up as it goes.

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • E
                        eri--
                        last edited by

                        That gets complicated quickly with single instance of dnsmasq.
                        Your only choice is multiple dnsmasq instances and keep track of them.

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