[Dnsmasq-discuss] leases being removed from lease file on startup
simon at thekelleys.org.uk
Sat Oct 29 10:53:32 BST 2011
On 29/10/11 01:44, Tom Metro wrote:
> I have Dnsmasq v2.57 running on a router (Tomato USB), where it gets
> invoked as 'dnsmasq -c 1500 --log-async' and uses a config like (edited):
> # persistent lease file
> # static DHCP hosts
> The router gets rebooted daily, and I'm trying to get the "static" lease
> to persist across reboots. Here's what I'm seeing:
> 1. Router restarts.
> 2. cctv1 reboots, requests a lease, and is added to lease file.
> 3. cctv1 is pingable by name.
> 4. Router is rebooted.
> 5. Initially cctv1 still exists in lease file.
> 6. A ping of cctv1 fails with a bad host name, and has disappeared from
> the lease file.
> The expectation is that in step 6 the cctv1 client should still be
> pingable. What caused it to disappear from the lease file?
The expiration time (first field in the relevant line in the leases
file) is less (earlier) than the current time. You configuration means
that dnsmasq will offer an infinite lease to the cctv, but it may choose
to take out a shorter lease. What value is there.
The following hack may solve your problem.
1) stop dnsmasq
2) edit the leases file and make the lease expiry time for cctv1 0
3) restart dnsmasq
Note that 0 means "infinite - never expires" in this context.
> Also, I don't understand how the 'dhcp-authoritative' directive (quoting
> the man page) "allows dnsmasq to rebuild its lease database without each
> client needing to reacquire a lease, if the database is lost." I'm not
> sure how that could work.
The relevant situation is when a client renews a lease which dnsmasq
doesn't know about. without "dhcp-authoritative" it will reject the
transaction and cause the client to go through a complete DHCP cycle -
that complies with the standard. With "dhcp-authoritative" is will
quietly put the lease into the database and continue as if nothing were
More information about the Dnsmasq-discuss