[Dnsmasq-discuss] [PATCH] Support for reading the ISC dhcp lease file

Michael Tremer michael.tremer at ipfire.org
Thu Jul 31 13:59:53 BST 2014


Hello Simon,

thanks for your reply.

On Wed, 2014-07-30 at 22:24 +0100, Simon Kelley wrote:
> On 30/07/14 11:51, Michael Tremer wrote:
> > Hello fellow dnsmasq users,
> > 
> > I am working on the free firewall distribution called IPFire
> > (www.ipfire.org) and inside of that distribution, dnsmasq is used as a
> > DNS proxy. For the DHCP services, we use the ISC dhcp daemon.
> > 
> > In the past, dnsmasq supported importing the leases from the ISC dhcpd
> > lease file which then was unfortunately removed because the code was
> > unmaintainable. I am not fully aware of the reasons.
> 
> The reason was very simple. The first versions of dnsmasq were just DNS
> forwarders, nothing to do with DHCP. Then the ability to read ISC lease
> files was added, which allowed DHCP-allocated addresses to be added to
> the DNS. This was a good idea, but a bit of a hack, so instead, long
> ago, the DHCP server code was added to dnsmasq, with integration with
> the DNS side. Finally, after plenty of warning, the now redundant
> ISC-leasefile reading code was removed.

Makes perfectly sense.

> We've seen calls to add this code back before, but the question which
> I've never seen answered is why it's necessary to use the ISC server and
> not the built-in dnsmasq one. The DHCP code in dnsmasq is now very
> mature, and I'm not aware of anything it can't do that the ISC code can,
> in the niche where dnsmasq is appropriate.
> 
> If I knew of a good reason to favour the ISC dhcpd over the dnsmasq one,
> I'd be in a better position to judge if this patch is a good idea.

The reason why we use the ISC dhcp server is basically our history. The
web user interface is writing configuration files for ISC dhcpd and we
didn't really want to rework that when dnsmasq supported DHCP.

You are probably right that dnsmasq comes with everything you need. I am
not sure about the latest IPv6 developments and if it supports pools and
steering some devices identified by their MAC addresses into those
pools. Those features are certainly ones that the vast majority of
dnsmasq users doesn't need or use. I cannot name *the* reason why ISC
dhcp is superior - it isn't. It might have some features that dnsmasq
does not have and dnsmasq might have some features that ISC dhcp does
not have.

My personal reason is that I find the configuration file of the ISC dhcp
daemon much better to read/write. dnsmasq is not that intuitive.

So there is no major technical reason that springs to mind. It's mainly
personal preference. I don't really know if that is sufficient to
include the code. It would be a unique feature of dnsmasq that I
couldn't find in any of the alternatives.

> > Our workaround was to stick with a very old version of dnsmasq. Now that
> > there are things like DNSSEC and that backporting security fixes it not
> > a pleasant thing to do, I took the old code and made it work with the
> > current master branch.
> > 
> > I started with the old code from John Volpe and Simon and cleaned it up
> > step by step. Some things like parsing the date was unnecessarily
> > complicated and I think that the attached patch is much cleaner. It has
> > been tested a lot by our community and is working well.
> > 
> > There is also a git branch where you can pull my changes from:
> > 
> >   http://git.ipfire.org/?p=people/ms/dnsmasq.git;a=shortlog;h=refs/heads/dhcp-lease
> > 
> > I would really like to see this included in dnsmasq. There are also
> > various bugs in the bugtrackers of various distributions like Debian and
> > so on.
> > 
> > Maybe we can work out the problems and get this merged.
> 
> It looks like a good basis for adding the feature, but let's decide if
> it's a good feature to have, first.

Good plan.

-Michael

> 
> 
> Cheers,
> 
> Simon.
> 
> > 
> > Best,
> > -Michael
> > 
> > 
> > 
> > 
> 
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss




More information about the Dnsmasq-discuss mailing list