<div dir="ltr">Hey - that worked! Setting my leases to 12 hrs fixed everything. Heh, I guess there are some subtleties in interpreting "infinite".<div><br></div><div>For completeness:</div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)"># Old. not working.</span></div><div><span style="color:rgb(80,0,80)"># dhcp-host=<livingroom_pc_MAC_r</span><span style="color:rgb(80,0,80)">edacted>,192.168.0.150,livingr</span><span style="color:rgb(80,0,80)">oom.internal,infinite</span><br></div><div><span style="color:rgb(80,0,80)"><br></span></div><div><span style="color:rgb(80,0,80)"># New, working.</span></div><div><span style="color:rgb(80,0,80)"># Diff:</span></div><div><span style="color:rgb(80,0,80)"># - 12 hour lease, not infinite</span></div><div><span style="color:rgb(80,0,80)"># - Don't even need the .internal suffix</span></div><div><span style="color:rgb(80,0,80)"># Removed hosts file</span></div><div><span style="color:rgb(80,0,80)">dhcp-host=<livingroom_pc_MAC_r</span><span style="color:rgb(80,0,80)">edacted>,192.168.0.150,</span><span style="color:rgb(80,0,80)">[::0:10</span><span style="color:rgb(80,0,80)">00],</span><span style="color:rgb(80,0,80)">livingr</span><span style="color:rgb(80,0,80)">oom,12h</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 21, 2020 at 1:54 PM Geert Stappers <<a href="mailto:stappers@stappers.nl" target="_blank">stappers@stappers.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Tue, Apr 21, 2020 at 09:57:34AM -0400, Jiawen Chen wrote:<br>
> On Tue, Apr 21, 2020 at 3:06 AM Geert Stappers wrote:<br>
> > On Mon, Apr 20, 2020 at 10:27:11PM -0400, Jiawen Chen wrote:<br>
> > ><br>
> > > I'm using dnsmasq for DHCP + DNS on my home LAN and use dhcp-host to<br>
> > > statically assign an IP address and hostname. However, I'm discovering that<br>
> > > while it works most of the time, sometimes, ssh for example, can't find the<br>
> > > host by name, only IP. One instance is a Linux VM. Initially I can ssh into<br>
> > > the VM. But if I power down the VM for say a few days, and start it back<br>
> > > up, the name is missing (even though it is somehow assigned the same IP (it<br>
> > > keeps its MAC)).<br>
> > ><br>
> > > dnsmasq.conf:<br>
> > > ```<br>
> > > # other irrelevant stuff<br>
> > > ...<br>
> > > # Assign 192.168.0.150 to my living room pc<br>
> > > dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,livingroom.internal,infinite<br>
> > ><br>
> > > # Assign 192.168.0.151 to my file server<br>
> > > dhcp-host=<fileserver_MAC_redacted>,192.168.0.151,fileserver.internal,infinite<br>
> > > ```<br>
> ><br>
> > I suggest to change the ',infinite' into something like ',12h' for<br>
> > the servers that are be powered-off of for several days.<br>
> ><br>
> > What I think is that the DNS cache entry expires<br>
> > ( and I think that it is valid behaviour.)<br>
> ><br>
> ><br>
> > Expriment that can be done:<br>
> ><br>
> > * Restart dnsmasq, so it forgets about dhcp-hosts in DNS cache<br>
> > * Check cache dump with SIGUSR1<br>
> > * Power-on an infinite DHCP client e.g. the Linux VM<br>
> > * Check cache dump with SIGUSR1<br>
> > * Regular work with the example Linux VM<br>
> > * Power-off the infinite DHCP client<br>
> > * Sample several days the cache dump<br>
> > * Report when the DNS entry of the powered-off server is gone<br>
> ><br>
> <br>
> Thanks! That makes sense. I will give that a shot.<br>
<br>
<br>
Cool. I look forward on feedback.<br>
<br>
<br>
<br>
Groeten<br>
Geert Stappers<br>
-- <br>
Silence is hard to parse<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="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" rel="noreferrer" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div>