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 ?
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.