[Dnsmasq-discuss] Supporting more than one domain.

Ben abnormaliti at clivepeeters.com.au
Tue Jul 29 02:43:21 BST 2008


Simon Kelley wrote:
> 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?
>   
That would be fine by me.  I would prefer a consistent syntax like 
"net:network-id" but if that isn't practical then i will survive.
> 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?
>   
Fine by me.

So to make sure i am clear a configuration would look like this, right?

    domain=sub1.example.com.au,192.168.1.0/24
    domain=sub2.example.com.au,192.168.2.0/24

    local=sub1.example.com.au
    local=sub2.example.com.au

    dhcp-range=subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
    dhcp-range=subnet2,192.168.2.100,192.168.2.254,255.255.255.0,24h

    dhcp-option=subnet1,15,sub1.example.com.au
    dhcp-option=subnet2,15,sub2.example.com.au

    dhcp-boot=net:subnet1,/pxelinux.0


While i am at it can i also request that support for the 
"net:network-id" syntax be supported wherever network-id's can be used?
Using the example above i would like to be able to keep things 
consistent and clearer like this.

    dhcp-range=net:subnet1,192.168.1.100,192.168.1.254,255.255.255.0,24h
    dhcp-option=net:subnet1,15,sub1.example.com.au
    dhcp-boot=net:subnet1,/pxelinux.0


Ben



More information about the Dnsmasq-discuss mailing list