[Dnsmasq-discuss] spin-off: dictionary order import of addn-hosts dirs?

Geert Stappers stappers at stappers.nl
Thu Aug 12 19:33:13 UTC 2021

On Thu, Aug 12, 2021 at 07:30:59PM +0200, john doe wrote:
> On 8/12/2021 5:04 PM, Simon Kelley wrote:
> > On 11/08/2021 00:25, Ed W wrote:
> > > On 10/08/2021 23:12, Simon Kelley wrote:
> > > > On 08/08/2021 14:02, Ed W wrote:
> > > > > On 19/07/2021 18:52, Ed W wrote:
> [snip]
> > --dhcp-hostsdir --dhcp-optsdir and --hostsdir work in much the same way
> > as when the first three options are given a directory; the files are
> > read at start-up and when SIGHUP is received. BUT any file which is
> > modified or created gets read asynchronously, without needing SIGHUP to
> > be sent. Note that the old data from the files is not discarded when
> > this is done: if a file gets modified, then it gets re-read but data
> > from the previous version of the file is not deleted. This means that
> Why is deleting not happening when the file is reread?

Expensive operation.

Reading a file and adding / updating each entry in memory
is simple algorithm.

Going through memory entries and all entries in all files
and keeping track which entries should remain
is a way more complex algorithm.

> > this facility is useful for adding hosts to the configuration without
> > the upheaval of a full SIGHUP re-read. Anytime you want to delete stuff,
> > SIGHUP is still needed.
> > 
> In other words,
> what is the reasoning behind requiring SIGHUP to delete stuff?

SIGHUP is actual "flush all and reread all"

Between flush all and all reread, there can be DNS queries
which then can't  be answered as when all have been rereaded.

> John Doe

Geert Stappers
Silence is hard to parse

More information about the Dnsmasq-discuss mailing list