[Dnsmasq-discuss] When does dnsmasq read the leases file?
Matus UHLAR - fantomas
uhlar at fantomas.sk
Fri Feb 11 19:32:27 UTC 2022
>> On 2/10/22 22:33, Chris Green wrote:
>> > As per the subject when does dnsmasq [re]read the leases file?
>On Fri, Feb 11, 2022 at 12:16:52AM +0100, Petr Menšík wrote:
>> 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.
On 11.02.22 09:01, Chris Green wrote:
>So does that mean there's no way to 'warm start' an instance of dnsmasq
>with a set of leases?
as Petr said, when dnsmasq starts, it reads the leases file.
not after.
>> > 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?
>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?
since it reads leases file on start, copying them to second system and
starting dnsmasq there would cause reading the leases file.
however, copying it to system with running dnsmasq would cause losing that
file.
If you want dhcp synchronization, better use isc-dhcpd or kea-dhcpd.
for manual (or semi-automatic) transition copying leases file could work.
--
Matus UHLAR - fantomas, uhlar at fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
If Barbie is so popular, why do you have to buy her friends?
More information about the Dnsmasq-discuss
mailing list