<div dir="ltr"><div dir="ltr">On Fri, 3 Sept 2021 at 15:16, 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 01:58:54PM +0100, Jesus M Diaz wrote:<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<br>
> that<br>
> if/when the running dnsmasq fails I can start the other and it will<br>
> give out the same IPs.<br>
> <br>
> Do you really need this? I mean, if dhcp server dies and you have a<br>
> stand-by backup that takes over immediately, the renew request from the<br>
> hosts will be to use the same IP address, so if you don't have the<br>
> dnsmasq.lease file, ergo there are no leases at the moment, dnsmasq<br>
> would grant the same (requested) IP address.<br>
<br>
That's why I asked the question about persistence of IP address, does<br>
a client give a 'hint' to the DHCP server that it would like the same<br>
IP again? However it's trivial to copy the contents of the leases<br>
file across so it's not a big issue.<br>
<br></blockquote><div><br></div><div>This is the (reduced) log for a DHCP request (renew):</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">Sep 3 14:30:23 cinemateka dnsmasq-dhcp[1584]: 3647601719 DHCPREQUEST(eth0) 192.168.0.13 56:de:02:57:de:02
</span><br>Sep 3 14:30:23 cinemateka dnsmasq-dhcp[1584]: 3647601719 DHCPACK(eth0) 192.168.0.13 56:de:02:57:de:02 outdoor<br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">You can see the client (</span>56:de:02:57:de:02<span style="font-family:monospace">) requests the in-use IP address. If it is a valid one, the server will accept and ack it.</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">If the request is not valid (for whatever reason), the server denies, and the host initiates a new request (without previous IP address)</span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">Sep 3 12:12:53 cinemateka dnsmasq-dhcp[1584]: 1717759439 DHCPREQUEST(eth0) 192.168.0.215 56:de:02:09:15:3e
</span><br>Sep 3 12:12:53 cinemateka dnsmasq-dhcp[1584]: 1717759439 DHCPNAK(eth0) 192.168.0.215 56:de:02:09:15:3e address in use<br></span></div><div><span style="font-family:monospace">Sep 3 12:12:56 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPDISCOVER(eth0) 56:de:02:09:15:3e
<br>Sep 3 12:12:56 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPOFFER(eth0) 192.168.0.222 56:de:02:09:15:3e
<br>Sep 3 12:12:56 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPDISCOVER(eth0) 56:de:02:09:15:3e
<br>Sep 3 12:12:56 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPOFFER(eth0) 192.168.0.222 56:de:02:09:15:3e
<br>Sep 3 12:12:57 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPREQUEST(eth0) 192.168.0.222 56:de:02:09:15:3e
<br>Sep 3 12:12:57 cinemateka dnsmasq-dhcp[1584]: 1717759440 DHCPACK(eth0) 192.168.0.222 56:de:02:09:15:3e XXXXXXX<br></span></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<br>
> server has<br>
> changed address.<br>
> <br>
> Why don't you always include both DNS servers, so if one dies, the<br>
> second one will be there anyway?<br>
<br>
I was thinking about the usual "one local server and 1.1.1.1 or<br>
8.8.8.8 as secondary" but now I think about it I suppose there's<br>
nothing difficult about providing two local servers. However will<br>
having one of them non-functional slow things down at all?<br>
<br>
<br>
So:-<br>
<br>
1 - How do I configure dnsmasq to give two DNS server addresses?<br>
<br>
2 - Will only actually having one listening cause any delay?<br>
<br></blockquote><div><br></div><div>2 examples:</div><div><br></div><div><span style="font-family:monospace"><span style="color:rgb(0,0,0)">option:dns-server,192.168.0.99,192.168.0.1 # 2 static dns server
</span><br><br></span></div><div><span style="font-family:monospace">option:dns-server,0.0.0.0 # 0.0.0.0 dns server means 'DHCP server IP address'<br></span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
Chris Green<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk" target="_blank">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div></div>