<div dir="ltr"><div dir="ltr">On Fri, 3 Sept 2021 at 13:41, Chris Green <<a href="mailto:cl@isbd.net">cl@isbd.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Sep 03, 2021 at 12:08:20PM +0100, Ed W wrote:<br>
> On 03/09/2021 11:31, Chris Green wrote:<br>
> > Two questions really:-<br>
> ><br>
> >     Is the file /var/lib/misc/dnsmasq.leases the only place where<br>
> >     dnsmasq keeps DHCP/IP/Name information across restarts?  I.e. if I<br>
> >     delete that file will new DHCP requests get new IPs?  (or does the<br>
> >     client have some memory of the last IP it got?)<br>
> ><br>
> ><br>
> >     If a client's DHCP lease expires and it sends a new DHCP request<br>
> >     out, which fails, will it continue to use the old values or will<br>
> >     it just die?<br>
> ><br>
> ><br>
> > I realise /var/lib/misc/dnsmasq.leases is not cast in stone and could<br>
> > be a different file but I'm sure it's clear what question I'm asking.<br>
> ><br>
> <br>
> My understanding is yes to this.<br>
> <br>
> Dnsmasq keeps it's database completely in ram while running. It updates <br>
> the disk "periodically" (ie <br>
> whenever the in ram changes), and calls some external events at the same time.<br>
> <br>
> To be precise I believe you need to first stop dnsmasq before erasing the disk cache (however, I<br>
> regularly get away with doing so while it's running... ;-) )<br>
> <br>
I wasn't considering erasing/deleting the dnsmasq.leases file, I was<br>
rather thinking of copying it to a non-running backup dnsmasq so that<br>
if/when the running dnsmasq fails I can start the other and it will<br>
give out the same IPs.<br></blockquote><div><br></div><div>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.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The only other issue is then how to tell 'everyone' that the DNS server has<br>
changed address.<br>
<br></blockquote><div><br></div><div>Why don't you always include both DNS servers, so if one dies, the second one will be there anyway?</div><div><br></div><div><br></div><div> //JM</div></div></div>