[Dnsmasq-discuss] flush dhcp lease cache

Gabriel Klawitter gabreal at lavabit.com
Thu Jul 4 18:21:50 BST 2013


On 07/04/2013 06:46 PM, Simon Kelley wrote:
> On 04/07/13 12:44, gabriel wrote:
>>
>>
>> hello,
>>
>> is it somehow possible (signal, etc) to flush dnsmasq's internal dhcp
>> lease cache?
>>
>> i want to be able to update ip addresses without restarting dnsmasq. So
>> I send a SIGHUP to dnsmasq to reread its host definition files. But
>> althought I've disabled the leasefile (leasefile-ro) and enabled a
>> script to run the machines still get their old addresses.
>>
> 
> If you've disabled the leasefile, then the problem is likely to be that
> the DHCP client is remembering what address it had last, and asking for
> that address again. dnsmasq will give the client the address is asks for
> if it's OK (not in use, still on a configured network, etc).
> 
> You could remove the caches in your hosts too, or configure static
> addresses for them in dnsmasq. Dnsmasq will force the static address,
> rather than one a client asks for.
> 

i'm testing this with kvm virtual machines, and they keep their old
address across destroy/restart. i actually also tried:

dhcp_release <bridge> <if> <mac>

in order to invalidate these leases. in fact i've configured these hosts
through additional hosts file (for static dns) and additional conf file
by host-record, txt-record, dhcp-record statements.

i want to change these statically configured hosts ip addresses without
dnsmasq restart.


thanks a lot,
gabriel








More information about the Dnsmasq-discuss mailing list