[Dnsmasq-discuss] Getting dnsmasq to serve fqdns as the hostname

Simon Kelley simon at thekelleys.org.uk
Wed Oct 15 21:38:34 BST 2008

Alex Kiernan wrote:
> On Tue, Oct 14, 2008 at 3:07 PM, Simon Kelley <simon at thekelleys.org.uk> wrote:
>>Alex Kiernan wrote:
>>>On Tue, Oct 14, 2008 at 1:58 PM, Simon Kelley <simon at thekelleys.org.uk>
>>>>Alex Kiernan wrote:
>>>>>I'm trying to use dnsmasq to serve DHCP/DNS for a Solaris network
>>>>>install server (jumpstart). It works perfectly and the DNS/DHCP
>>>>>integration means that lots of the traditional problems go away (the
>>>>>problem is that the Solaris installation procedure won't setup DNS as
>>>>>the name service unless you already have DNS for the machine you're
>>>>>building in place).
>>>>>dnsmasq works absolutely perfectly for this, with one minor problem -
>>>>>I need to serve an FQDN in the hostname option; if I feed this to
>>>>>dnsmasq in a dhcp-host then unless my domain setting matches it
>>>>>rejects it, and even then it strips it to the basename. If instead I
>>>>>force through an option 12, whilst it serves the FQDN, it doesn't
>>>>>update the DNS so the DNS checks fail later in the install.
>>>>>At the moment I'm working around it by removing the section of code
>>>>>from check_dhcp_hosts which enforces the domain/fqdn
>>>>>matching/stripping behaviour, but is there another way? Or another way
>>>>>which I could implement which is cleaner?
>>>>If you explicitly send the FQDN as option 12, set the basename (using
>>>>dhcp-host) _and_ set the domain in dnsmasq to the correct value, I think
>>>>that will do what you want assuming I've understood correctly that you
>>>>1) Send the FQDN as option 12
>>>>2) have the FQDN resolve in DNS to the IP address allocated.
>>>Yeah, I should have mentioned that combo - it does exactly what I
>>>need, but only for one domain, whereas I need it to work for many
>>>domains (as I want this box to act as a jumpstart server across many
>>>different hosts). If domain could be scoped with a tag that'd do what
>>>I need (or even just support multiple maybe?)
>>That (domain scoped with a tag) is a long-standing feature request which is
>>impossible to do in a backwards compatible way. See this list passim for the
>>gory details.
>>HOWEVER, the next best thing (domain based on subnet or IP address range) is
>>available at the bleeding edge. Try
> Thanks - I've had a play and it doesn't really do what I want as
> whilst I have some networks which have one domain on a subnet, we have
> others where we end up with a bunch of machines in differing domains.
> Is there a good way to go about adding FQDN hostname functionality[1]?
> If I could just add that one feature it'd do exactly what I need (when
> coupled with the dhcp-fqdn option).
> [1] which I'm happy to do and send you the diffs.

The problem is that the format of the leases file is fixed to contain a 
non-fully qualified domain, and no domain field. To work, dnsmasq has to 
be able to determine the FQDN of a host using just the information in 
the leases file. Hence the new arrangement, which allows the domain to 
be derived from the IP address.

To allow arbitrary domains means breaking the lease file format, which I 
don't want to do.

Presumably, you add some configuration for each new host that you 
install, if that consists of something like

dhcp-host=<mac address>,<IP address>,<bare name>,net:<FQDN>

then that should work, domains don't have to be over whole subnets, just 
defined by IP address.


More information about the Dnsmasq-discuss mailing list