[Dnsmasq-discuss] Supporting more than one domain.

Simon Kelley simon at thekelleys.org.uk
Mon Jul 28 15:19:31 BST 2008


I've been thinking about this again, prompted by

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2008q3/002208.html

I know that it's something many people want. The problem in providing it
is that the domain information associated with a DHCP lease is not
stored in the leases file. Adding this breaks backward compatibility.

Ben's suggestion (multiple lease files) is not something I'm keen on,
since it really only disguises the backwards-compatibilty problem and it
doesn't address similar problems when the lease database is held in an
external database.

However, it did light a lightbulb, most people who want multiple domains
probably want them associated with particular IP address ranges, (or at
least can organise things to make that true.) Given that each lease has
to have an IP address, that makes mapping from lease to domain perfectly
simple. It also makes use of the domain to expand names in /etc/hosts
work well (see the --expand-hosts flag)

So, here is a suggestion:

Elaborate the "domain=" config option so that, as well as

domain=example.org

the following are also valid

domain=example.org,192.168.100.128,192.168.100.180
domain=subnet.example.org,192.168.100.0/24
domain=anothernet.example.org,2001:db8:100:f101:210:a4ff:fee3:9566/64

Multiple domain lines are now allowed, and the smallest address range
which matches will be used. The IPv6 version is useful for /etc/hosts
and --expand-hosts, it's clearly not used for DHCP (which is IPv4 only
in dnsmasq).

This has lots of advantages: it's completely backwards-compatible with
existing configs, it's straightforward to use, and straightforward to
implement.

What do people think, would that be sufficiently useful?

As part of implementing this, I'd like to try (again) to remove the
long-deprecated ISC lease-file reading code. If I don't remove it, it
will need work to fit in with the new facilities. I've tried to remove
this code before and had complaints; can I assume by now that that code
is dead?

Cheers,

Simon.



More information about the Dnsmasq-discuss mailing list