Timeout control

Hi,

I’m trying to use asynchronous interface from unbound (ub_resolve_async) and I do have a problem.
When running DNS queries which receive no response from the nameservers (lame delegation),
it locks the program and keeps trying forever (iterator module). Same thing happens running query
with unbound-host command.

I’ve studied the documentation, but I didn’t find any information on how should I
configure the timeouts. Do you have any clues ?

Regards,
Vitalie Cherpec

Example output:

[vitalie@silver ~]$ time unbound-host -4 www.example.com
Host www.example.com not found: 2(SERVFAIL).
Host www.example.com not found: 2(SERVFAIL).
Host www.example.com not found: 2(SERVFAIL).

real 19m17.427s
user 0m0.011s
sys 0m0.011s

Hi Vitalie,

The timeouts depend on the exact roundtrip times as observed, and the
nameservers for the domain. If you want to have a timeout in your
software in case the resolution takes a long time, perhaps you want to
use alarm(2) or another timeout mechanism (e.g. from libevent).

Such as, use select(2) on the ub_fd() with the timeout of your choice.
You can use ub_cancel() to tell libunbound that the result of this query
is no longer needed.

Best regards,
   Wouter

Hi Wouter,

I’ve followed your tips, now I’m controlling the timeout from libev using file descriptor returned by ub_fd().

Thank you !

Regards,
Vitalie Cherpec