<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Along this line, how much effort would it take to program dnsmasq to:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  - understand the idea of two concurrent instances of dnsmasq on the network<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  - use UDP to 'copy' each new lease to the other instance</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  - on startup, use UDP to request a sync of known leases from the other instance</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
  - maybe sync local DNS entries as well (though it might be less desirable for folks</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    like me who have 850k 'undefined' entries for ads, pron, warez, etc.)<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Could this even work? Would it be worth the effort?<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
N<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Dnsmasq-discuss <dnsmasq-discuss-bounces@lists.thekelleys.org.uk> on behalf of Simon Kelley <simon@thekelleys.org.uk><br>
<b>Sent:</b> Friday, February 4, 2022 4:28 PM<br>
<b>To:</b> dnsmasq-discuss@lists.thekelleys.org.uk <dnsmasq-discuss@lists.thekelleys.org.uk><br>
<b>Subject:</b> Re: [Dnsmasq-discuss] Copying dnsmasq.leases, any issues to be aware of?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 04/02/2022 18:16, Chris Green wrote:<br>
> I'm looking at ways to provide backup DHCP/DNS with dnsmasq.  This is<br>
> on a small, fairly 'quiet' home LAN so there aren't dozens of clients<br>
> connecting and disconnecting every second.  Also if DHCP/DNS is not<br>
> available for a few minutes the world won't end! :-)<br>
> <br>
> So, I'm proposing to have dnsmasq installed on two systems, one (say<br>
> dns1, 192.168.1.2) is the live DHCP/DNS server, the other (say dns2,<br>
> 192.168.1.3), both with static IP.<br>
> <br>
> If dns1 dies or needs to be turned off I just copy the dnsmasq<br>
> configuration (stored elsewhere as well of course) to dns2 and also<br>
> copy the dnsmasq.leases file and [re]start dnsmasq on dns2.  Will this<br>
> work reasonably OK?  I.e. if/when a system on the LAN broadcasts a<br>
> DHCP request will it get the same IP again?<br>
> <br>
> It's not a disaster if a system gets a different IP anyway, if<br>
> something *really* needs a fixed IP I can add a dhcp-host in the<br>
> dnsmasq configuration.<br>
> <br>
> I can even have dnsmasq running on dns2 all the time with it<br>
> configured to provide only local DNS and no DHCP, then it's just 'copy<br>
> dnsmasq configuration, copy dnsmasq.leases, restart dnsmasq.<br>
> <br>
> (All my systems run syncthing so it's very easy to have pretty much<br>
> live copies of files synchronised across systems)<br>
> <br>
<br>
To be honest, even if you didn't bother copying the leases file, most <br>
systems would get the same address. The clients try to renew the lease <br>
on the exiting DHCP server and when they get no response they broadcast <br>
the renewal to try and find a new server. As long as there's no reason <br>
not to, the new server will accept the client's request for the address <br>
it already had.<br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
Dnsmasq-discuss@lists.thekelleys.org.uk<br>
<a href="https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss">https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss</a><br>
</div>
</span></font></div>
</body>
</html>