[Unbound-users] doubt for unbound process flow when run command "dig @localhost . ns"
wouter at nlnetlabs.nl
Thu Mar 20 08:19:12 UTC 2014
-----BEGIN PGP SIGNED MESSAGE-----
On 03/20/2014 08:26 AM, Jianjun Ning wrote:
> all, when I run command "dig @localhost . ns",I used tcpdump to
> capture the DNS packets,I found that unbound query root DNS server
> twice, why?
The first is the root prime query, the second is the query to fetch
your answer. The reason it does it twice is that the first query is
run while the state machine in unbound does not perform further
recursions, and the second has the state machine set to store the
answer for the user. So, with the first it fetches the addresses of
the root servers and the second asks one of those root servers for the
answer you wanted. Realistically, the answer is stored in cache and
the second query is not necessary, but there is no code there that
checks the cache for contents; the cache-check code is in a different
position in the implementation. I do not think that this query needs
to have special-case code added to avoid the second query.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----
More information about the Unbound-users