[Dnsmasq-discuss] re-reading dhcp options without restart

Carlos Carvalho carlos at fisica.ufpr.br
Sat Oct 6 23:32:15 BST 2007


Back in June when 2.40 was at test12 and --dhcp-hostsfile was
introduced I said that I also need to re-read dhcp options. Here's
what Simon said:

 >>  >http://www.thekelleys.org.uk/dnsmasq/test-releases/dnsmasq-2.40test12.tar.gz
 >>  >
 >>  >has this code: see the --dhcp-hostsfile switch.
 >> 
 >> Unfortunately that's not enough :-( :-( It only allows one to read
 >> dhcp-host declarations but it's also necessary to allow dhcp-option
 >> specifications. My dhcp-hosts file consists of a series of
 >> 
 >> dhcp-host=name,MAC,id:*,net:name
 >> dhcp-option=name,vl7,3,router-ip
 >> some other options
 >> 
 >> Allowing changes to the host declaration only is somewhat restrictive...
 >
 >There's a limit as to what can be changed on the fly: depending on how 
 >data structures get used. (When re-reading a file it's first necessary 
 >to remove stuff which came from the last read: if that's in use 
 >elsewhere it all breaks....)

 >> Also I'd need to re-read addn-hosts, like it's done with /etc/hosts.

This I can do without but it'd be good for completeness (and symmetry).

 >It's probably possible to do options, dhcp-range is not possible.

Agreed about dhcp-range. However having the possibility to re-read the
options would be very useful here because it'd reduce the number of
restarts by a factor of 10 at least.

So you can consider this as a feature request :-)

 >I wonder, would it be best to make the dhcp-hostfile have dhcp-host= and 
 >dhcp-option= lines, like the standard config, or have a different file 
 >for each with the hosts as now, and a --dhcp-optionsfile separate.

For me it'd be really better to allow options in --dhcp-hostsfile but
if you choose the other option I'm fine.

I'm coming back to this subject because of the possibility of using
dnsmasq for the central server. Presently it has all names in
/etc/hosts and dnsmasq is used only for client queries (because of
its wonderful localization feature). The problem is that a few
machines can take a different IP depending on the location. Since
Simon observed a few days ago that dnsmasq can handle this, I'd like
to remove the clients from /etc/hosts and make the central server also
use dnsmasq. And then I'd not like to restart it often...



More information about the Dnsmasq-discuss mailing list