[Dnsmasq-discuss] dnsmasq DHCP lease (in)validation question
Simon Kelley
simon at thekelleys.org.uk
Mon May 8 09:47:12 BST 2006
Heinz Deinhart wrote:
> Hi,
>
> i use dnsmaq(2.30) as a dhcp server with only static Adresses like this:
> dhcp-range=28.30.40.128,static,255.255.255.128,8h
> I have the information about hosts in /etc/ethers and /etc/hosts.
>
> I have a PC that currently has a lease (28.30.40.135). Now i change
> the IP of that PC in the hosts file to 28.30.40.202 and force dnsmasq
> to reread the files (HUP). Note that old lease is still in
> /var/lib/misc/dnsmasq.leases
>
> Now i reboot the client and it make and dnsmaq seems to assign the
> adresses (28.30.40.135) of the old lease. But it says:
> dnsmasq: not giving name flinders to the DHCP lease of 28.30.40.135 because the name exists in /etc/hosts with address 128.130.40.202
> Shouldn't dnsmasq be clever and discard the lease if it does not
> reflect the current hosts/ethers settings when a DISCOVER comes?
It's supposed to do that: it will refuse to renew the leasen if the the
host is configured somewhere else, this should cause the client to go
through the complete discover-offer-requset-ack sequence and move to the
new IP address. The presence of the old lease shouldn't matter.
>
> Or is this all my mistake and a missed the right config switch?
I think the problem here was that you HUPed dnsmasq, instead of
restarting it. HUP re-reads the hosts and ethers files, but the code
doesn't seem to purge old dhcp-host entries which were created last time
they were read. If you restart dnsmasq, then reboot/renew the client
does it work?
Cheers,
SImon.
>
> Thanks a lot,
> Heinz
>
>
More information about the Dnsmasq-discuss
mailing list