[Dnsmasq-discuss] Using cname to alias dhcp-host IDs

Geert Stappers stappers at stappers.nl
Thu Dec 24 07:36:08 GMT 2020


On Thu, Dec 24, 2020 at 07:09:28AM +0100, john doe wrote:
> On 12/23/2020 7:08 PM, Arthur Wiebe wrote:
> >  From reading the man page, and my understanding of the statement "Only one
> > hostname can be given in a --dhcp-host option, but aliases are possible by
> > using CNAMEs. (See --cname )" I've been attempting to implement this
> > without any success so far.
> > 
> > My goal is to have two names get assigned the same IP via DHCP. The purpose
> > of this is transitioning IPSec IDs as I have strongswan using dnsmasq to
> > assign static IPs to mobile clients.
> > 
> > In this example I would like both DEVICE_V1 and DEVICE_V2 to get the same
> > IP address 10.1.2.3 and my current attempted configuration is as follows.
> > 
> > /etc/hosts contains:
> > 
> > 10.1.2.3 DEVICE_V1
> > 
> > --
> > 
> > dnsmasq conf file contains:
> > 
> > cname=DEVICE_V2,DEVICE_V1
> > dhcp-host=DEVICE_V1,10.1.2.3,infinite
> > 
> 
> Couple of thoughts here and this assumes that DEVICE_V1 is having the
> correct IP before fiddling with cnames:
> 
> - Does it help if you remove the line from /etc/hosts file and only use
> the 'dhcp-host' statement?
> 
> With 'dhcp-host' as shown above, the client presenting the hostname
> 'DEVICE_V1' should get the fixed address shown above.
> 
> The cname option that you have, will let DNS resolve  'DEVICEV1' or
> 'DEVICE_V2'.
> 
> So 'host DEVICE_V1' or 'host DEVICE_V2' should show for both the IP of
> DEVICE_V1.

Output of a DNS query command like `host` is indeed missing.
I'm looking forward to see the data that comes from it.


> - When Dnsmasq starts, is DEVICE_V1 present in the lease file?
> 
> Cnames are only created if the hostname is known to Dnsmasq when starting.
> 
> 
> John Doe

Hey John,


Thanks for making it possible to read in the discussion order.
It shows that you understand timezone differences. That you know
that you that people can quicker catch-up an email thread by
skipping the emails that arrived while they were asleep.


 

Regards
Geert Stappers
-- 
Silence is hard to parse



More information about the Dnsmasq-discuss mailing list