[Dnsmasq-discuss] DNS set using dhcp-host expires?

Jiawen Chen jiawen at gmail.com
Wed Apr 22 15:08:35 BST 2020


Hey - that worked! Setting my leases to 12 hrs fixed everything. Heh, I
guess there are some subtleties in interpreting "infinite".

For completeness:

# Old. not working.
# dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,livingr
oom.internal,infinite

# New, working.
# Diff:
# - 12 hour lease, not infinite
# - Don't even need the .internal suffix
# Removed hosts file
dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,[::0:1000],livingr
oom,12h

On Tue, Apr 21, 2020 at 1:54 PM Geert Stappers <stappers at stappers.nl> wrote:

> On Tue, Apr 21, 2020 at 09:57:34AM -0400, Jiawen Chen wrote:
> > On Tue, Apr 21, 2020 at 3:06 AM Geert Stappers wrote:
> > > On Mon, Apr 20, 2020 at 10:27:11PM -0400, Jiawen Chen wrote:
> > > >
> > > > I'm using dnsmasq for DHCP + DNS on my home LAN and use dhcp-host to
> > > > statically assign an IP address and hostname. However, I'm
> discovering that
> > > > while it works most of the time, sometimes, ssh for example, can't
> find the
> > > > host by name, only IP. One instance is a Linux VM. Initially I can
> ssh into
> > > > the VM. But if I power down the VM for say a few days, and start it
> back
> > > > up, the name is missing (even though it is somehow assigned the same
> IP (it
> > > > keeps its MAC)).
> > > >
> > > > dnsmasq.conf:
> > > > ```
> > > > # other irrelevant stuff
> > > >      ...
> > > > # Assign 192.168.0.150 to my living room pc
> > > >
> dhcp-host=<livingroom_pc_MAC_redacted>,192.168.0.150,livingroom.internal,infinite
> > > >
> > > > # Assign 192.168.0.151 to my file server
> > > >
> dhcp-host=<fileserver_MAC_redacted>,192.168.0.151,fileserver.internal,infinite
> > > > ```
> > >
> > > I suggest to change  the   ',infinite'   into something like  ',12h'
> for
> > > the servers that are be powered-off of for several days.
> > >
> > > What I think is that the DNS cache  entry expires
> > > ( and I think that it is valid behaviour.)
> > >
> > >
> > > Expriment that can be done:
> > >
> > >  * Restart dnsmasq,  so it forgets about dhcp-hosts in DNS cache
> > >  * Check cache dump with  SIGUSR1
> > >  * Power-on an infinite DHCP client e.g. the Linux VM
> > >  * Check cache dump with SIGUSR1
> > >  * Regular work with the example Linux VM
> > >  * Power-off the infinite DHCP client
> > >  * Sample several days the cache dump
> > >  * Report when the DNS entry of the powered-off server is gone
> > >
> >
> > Thanks! That makes sense. I will give that a shot.
>
>
> Cool.  I look forward on feedback.
>
>
>
> Groeten
> Geert Stappers
> --
> Silence is hard to parse
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20200422/0bbf32ec/attachment.html>


More information about the Dnsmasq-discuss mailing list