howto know if a query was delegated to cache

Chris Buxton chris.p.buxton at
Tue Jul 26 07:00:14 UTC 2011

On Jul 25, 2011, at 5:33 AM, Feng He wrote:

> There is a "rr" flag in the response which indicates the answer is not
> from a cache.

There is no 'rr' flag.

Perhaps you mean one of the following:

- 'aa' means that the server queried is authoritative for the answer. Not applicable to the OP's case.
- 'rd' means that the client requested recursion. Always on in the OP's case.
- 'ra' means that the server is willing to perform recursion on behalf of the client. Should always be on in the OP's case.

There is no reliable indication in the response packet that an answer came from the server's cache or required consultation with authoritative servers. Hints might be gleaned from TTLs and response time, but, again, these are not reliable.

In a sense, all answers from a non-authoritative (caching only) DNS server come from cache. Answers are fetched into cache as needed, so that cache can answer client queries. (May not be strictly true, but it is useful to think of it this way.)

Chris Buxton
BlueCat Networks

More information about the bind-users mailing list