[Dnsmasq-discuss] Questions about DHCP persistence and lease times

Jesus M Diaz jesusm.diazperez at gmail.com
Fri Sep 3 12:58:54 UTC 2021


On Fri, 3 Sept 2021 at 13:41, Chris Green <cl at isbd.net> wrote:

> On Fri, Sep 03, 2021 at 12:08:20PM +0100, Ed W wrote:
> > On 03/09/2021 11:31, Chris Green wrote:
> > > Two questions really:-
> > >
> > >     Is the file /var/lib/misc/dnsmasq.leases the only place where
> > >     dnsmasq keeps DHCP/IP/Name information across restarts?  I.e. if I
> > >     delete that file will new DHCP requests get new IPs?  (or does the
> > >     client have some memory of the last IP it got?)
> > >
> > >
> > >     If a client's DHCP lease expires and it sends a new DHCP request
> > >     out, which fails, will it continue to use the old values or will
> > >     it just die?
> > >
> > >
> > > I realise /var/lib/misc/dnsmasq.leases is not cast in stone and could
> > > be a different file but I'm sure it's clear what question I'm asking.
> > >
> >
> > My understanding is yes to this.
> >
> > Dnsmasq keeps it's database completely in ram while running. It updates
> > the disk "periodically" (ie
> > whenever the in ram changes), and calls some external events at the same
> time.
> >
> > To be precise I believe you need to first stop dnsmasq before erasing
> the disk cache (however, I
> > regularly get away with doing so while it's running... ;-) )
> >
> I wasn't considering erasing/deleting the dnsmasq.leases file, I was
> rather thinking of copying it to a non-running backup dnsmasq so that
> if/when the running dnsmasq fails I can start the other and it will
> give out the same IPs.
>

Do you really need this? I mean, if dhcp server dies and you have a
stand-by backup that takes over immediately, the renew request from the
hosts will be to use the same IP address, so if you don't have the
dnsmasq.lease file, ergo there are no leases at the moment, dnsmasq would
grant the same (requested) IP address.


>
> The only other issue is then how to tell 'everyone' that the DNS server has
> changed address.
>
>
Why don't you always include both DNS servers, so if one dies, the second
one will be there anyway?


 //JM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20210903/8f0ed133/attachment-0001.htm>


More information about the Dnsmasq-discuss mailing list