[Dnsmasq-discuss] leases being removed from lease file on startup
tmetro+dnsmasq at gmail.com
Sat Oct 29 17:43:22 BST 2011
Simon Kelley wrote:
> ...the expiry times are 108 and 51 seconds after 1st
> of Jan 1970 ie. well in the past. The NTP thing is exactly the problem.
OK, but even if Dnsmasq thinks the current time is 0 (1st Jan 1970), why
would the "infinite" lease be set to a duration that is only a few
minutes in the future? I don't get that.
> You have two possible solutions, either...re-compile dnsmasq
> with the HAVE_BROKEN_RTC flag. HAVE_BROKEN_RTC removes the need for sane
> system times and stores relative rather than absolute times in the
> leases file.
OK, good to know. Not something I can easily deploy, as Dnsmasq is
bundled as part of the router firmware, but I can submit a bug report to
have this addressed in a future release. (Or more painfully install a
custom Dnsmasq via optware.)
What is the downside to enabling this option?
> ...arrange that on boot dnsmasq is not started until after NTP has
> done its stuff...
What I'm wondering is will Dnsmasq do anything undesirable if it is
started before the time is set correctly, but no leases are requested
until after the time is set.
I'll repeat my test case while watching the time setting, and make sure
the client gets its lease only after the time has been set correctly.
Delaying the start of Dnsmasq until NTP runs introduces other problems.
NTP depends on the Internet connection working, so if the WAN link is
down, that'll mean that internal DNS is also down. As a result, LAN
devices are harder to reach to troubleshoot, and my security cameras
won't be able to find the internal SMTP server that spools notification
emails while the WAN is down. (There are work arounds, of course, like
using IPs for this scenario, or running an internal NTP server.)
>>> You configuration means that dnsmasq will offer an infinite lease to
>>> the cctv, but it may choose to take out a shorter lease.
>> Out of curiosity, why?
You didn't comment on this, other than ti say it is supported by the
DHCP spec. What's the advantage to returning a short lease? Why doesn't
Dnsmasq itself simply write a zero to the lease file?
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/
More information about the Dnsmasq-discuss