Caching in libunbound

Florian Obser florian at openbsd.org
Thu Mar 21 12:34:59 UTC 2019


On Thu, Mar 21, 2019 at 01:26:09PM +0100, Wouter Wijngaards via Unbound-users wrote:
> Hi Rick,
> 
> On 3/21/19 1:16 PM, Rick van Rein via Unbound-users wrote:
> > Ah...
> > 
> > I was thinking that Unbound might merge processes...
> > 
> >> However, the hope
> >> I had was that since Unbound == Unbound it might trust itself and allow
> >> two streams of requests to come together.
> > 
> > ...because it fork()ed a process in the background, which I assumed
> > might be a shared Unbound daemon.
> > 
> > Apparently this is just to service query/responses.  Unexpected, as I
> > had setup an event loop and was tidily calling ub_process() and
> > receiving its callbacks.
> > 
> > To be honest, I don't really understand why Unbound doesn't have a modus
> > operandi that supports event loops without thread or process!
> 
> It does, with the unbound_event api.  See libunbound/unbound-event.h
> 
> I believe this is also what getdns uses.

unwind(8) uses it and it works fine. https://man.openbsd.org/unwind.8

Have a look at
https://github.com/openbsd/src/blob/master/sbin/unwind/resolver.c for
inspiration on how to use it. check_resolver() on line 979 might be a
good starting point.

> 
> Best regards, Wouter
> 




-- 
I'm not entirely sure you are real.



More information about the Unbound-users mailing list