[Dnsmasq-discuss] Single-file config

Simon Kelley simon at thekelleys.org.uk
Tue Jul 6 20:56:17 BST 2010


Johan Vromans wrote:
> Jan Psota <jasiu at kkfsa.pl> writes:
> 
>> What about single option to turn on serving names for all hosts
>> specified in dhcp-host lines (files) even though the didn't ask for
>> an address yet (are turned off for example)?
>>
>> "static-ip-dns" or "static-dhcp-dns"?
> 
> That would be a nice feature. dns-use-dhcp-hosts?

But less flexible than dns-host, because it's all-or-nothing. It also
requires new behaviour to be defined, whilst just allowing the
equivalent of /etc/hosts lines doesn't. The semantics may be a bit
obscure, but they are at least easy to define in terms of current behaviour.

> 
>> I use a script to keep /etc/hosts in sync with
>> (dhcp-hostsfile=)/etc/dnsmasq.hosts because I want to be able to
>> ping/nmap any statically DHCPed machine.
> 
> I maintain a small database of systems and generate the DNS/DHCP info.
> It used to generate dhcp.conf, named.conf, domain, doman.rev but now
> it generates dnsmasq.conf, dnsmasq_dhcp and dnsmasq_hosts. Still the
> generated files need to be distributed to there's always a possibility
> of the _hosts and _dhcp files to get out of sync.
> 
> On a aside note: dnsmasq can poll /etc/resolv.conf for updates, why
> not poll the other relevant files (see SIGHUP) as well?

/etc/resolv.conf gets polled because there are things that modify it and
expect the effect to be immediate. (pppd, for instance) The downside is
that its rather racy: just overwriting /etc/hosts risks having dnsmasq
read a half-complete file. There are nasty hacks in there to try and
combat this problem, but the whole thing is a hack. Re-read on signal is
the better way, so polling is not implemented where it's not needed to
work-around other systems.

Cheers,

Simon.


> 
> -- Johan
> 
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
> 




More information about the Dnsmasq-discuss mailing list