The flags at the header will have "aa" to indicate the answer was authoritative.  You know it had to do a lookup through the TTL of the record, if the record's TTL is lower than the zone's, you know it was cached.

If it's answered recursively, ask again with +norecursive.  However the referral can be cached from your earlier query, so maybe start off with +norecursive.

Sean

On 3/7/07, John Lange <john.lange@open-it.ca> wrote:
Does anyone know if there is a way to tell if dig had to perform a
recursive query to return an answer?

This seems like it would be an obvious thing to indicate in a result but
it doesn't seem to show up anyplace.

So for example, in the query:

# dig @localhost www.somedomain.com

I'd like to know:

- did localhost consider itself the authorative answer?
- if not, did it return the result from local cache?
- or, did it recursively discover the result from out on the net?
- If it recursively discovered the answer, which server did it query to
get the answer?

In my testing, I performed some queries where I knew before hand the
answers to the above questions and then compared the results from dig
and I could find no definitive way to tell the difference in the
results.

Any dig masters want to give me some tips?

John


_______________________________________________
Roundtable mailing list
Roundtable@muug.mb.ca
http://www.muug.mb.ca/mailman/listinfo/roundtable




--
Sean Walberg <sean@ertw.com>    http://ertw.com/