libunbound: setting a deadline/timeout for ub_resolve

Alex Zorin ub-users at id-rsa.pub
Thu Jun 7 23:57:02 UTC 2018


Hello,

I'm using libunbound to perform iterative DNS lookups for a diagnostic service: github.com/letsdebug/letsdebug .

One of the problems I have is when one or more of a domain's authoritative nameservers are timing out, ub_resolve takes an incredibly long time to give up, something like ~10 minutes when the ub_ctx is configured with these options:

    https://github.com/letsdebug/letsdebug/blob/e56f10a5741445645c44a6d6683b9f085f657999/dns_util.go#L84-L116

I've tried to grok the meaning of https://www.unbound.net/documentation/info_timeout.html but I'm not seeing the solution after some weeks of pondering the problem..
 
Ideally I would like to place a deadline of something like 180 seconds on the ub_resolve operation. I am using a fresh ub_ctx for each lookup, which is done to avoid sharing any resolver state between lookups.

Do you have any further guidance on the ability to restrict ub_resolve's runtime?

Thanks!
Alex



More information about the Unbound-users mailing list