[Dnsmasq-discuss] Using dhcp-host hostname as address for DNS

gabriel gabreal at lavabit.com
Wed Aug 1 15:55:48 BST 2012


>>>>> My question is whether it would be possible to have a single
>>>>> line config statement for mac-ip-hostname mapping.
>>>>> But I want to have the DNS entries permanently preserved resp.
>>>>> dns mappings without prior dhcp ip negotiation. Actually this
>>>>> means I don't want DNS to be dynamic.
> 
>>>> so: in /etc/hosts
>>>>
>>>> 1.2.3.4 myhost
>>>>
>>>> in /etc/dnsmasq.conf
>>>>
>>>> dhcp-host=00:11:22:33:44:55,myhost
> 
>>> So this means that I can't maintain my hosts in a single file with
>>> only one statement?
> 
>> Single statement, not that I know of.
> 
>> Single file, sure. See "-A, --address" in the man page.
> 
>> in /etc/dnsmasq.conf :
> 
>> dhcp-host=00:11:22:33:44:55,myhost
>> address=/myhost/1.2.3.4
> 
> What about the addresses (not the "dhcp-host" definition(s)) in a  
> separate file:
> 
>   addn-hosts=/path/to/hosts.LAN
> 
> and a file "/path/to/hosts.LAN" like
> 
> # IP-address    Hostname
> 192.168.0.100   Host100
> 
> # etc

Currently my setup is that way. A seperate hosts file

addn-hosts=/etc/dnsmasq.d/hosts.dynamic

and my host definitions in dnsmasq.conf.d via dhcp-host. But to avoid
them to get out of sync I've written a dhcp-script

dhcp-script=/var/netboot/config/dnsmasq.sh

to update /etc/dnsmasq.d/hosts.dynamic automatically for dns entries to
be static. This appears a little bit cumbersome to me but I don't want
to manage two entries for a single host.

cheers.




More information about the Dnsmasq-discuss mailing list