[Dnsmasq-discuss] When does dnsmasq read the leases file?
Chris Green
cl at isbd.net
Fri Feb 11 09:01:34 UTC 2022
On Fri, Feb 11, 2022 at 12:16:52AM +0100, Petr Menšík wrote:
> On 2/10/22 22:33, Chris Green wrote:
> > As per the subject when does dnsmasq [re]read the leases file?
> >
> > I am experimenting with my backup DHCP/DNS strategy and I have just
> > stopped my dnsmasq server and started another listening on the first
> > dnsmasq server's IP address. It's working OK'ish. However the new
> > dnsmasq server doesn't (of course) know the name/IP pairs that the old
> > dnsmasq server had in its memory.
> >
> > If I had copied the dnsmasq.lease file across from the old server to
> > the new one would that help? Is there some way to tell dnsmasq to
> > reload its memory from the file? If dnsmasq is restarted (e.g. by
> > systemd) does it read the dnsmasq.leases file?
> >
> When it starts. It has own data stored in-memory and just rewrites lease
> file. It would not read any new leases from it if some other service
> pushed them there. If dnsmasq is restarted, it starts a new process. It
> has to read all configuration all again, which has to be done for leases.
>
So does that mean there's no way to 'warm start' an instance of dnsmasq
with a set of leases?
Surely when dnsmasq is stopped and then started it reads it's previous
leases file so that it still knows the names/IPs of systems that it
has provided IPs for. So if I copy that leases file to another system
and start a copy of dnsmasq there (with same configuration as the one
it's replacing) won't it read that leases file?
--
Chris Green
More information about the Dnsmasq-discuss
mailing list