1
This is how we handle the DNS header in the recursive client.
3
ID: Stored and given back to client; not cached
4
QR: Must be 0 for packet to be accepted; all replies give this a 1 value
5
OPCODE: Must be 0; 0 in replies
6
AA: Value in query ignored; 0 in replies
7
TC: Truncation. Ignore value in query; ignore replies where this is 1
8
(for now; we may do tcp stuff later)
9
RD: Must be 1 in query; is 1 in reply
10
RA: Ignored in query; is 1 in reply (because of brain-dead DNS clients)
11
Z: Must be all 0 in query; set to all 0 in reply
12
RCODE: Must be 0 in query; usually 0 (OK) in reply but can be 2 (server
13
failure) should we be unable to connect to any nameservers
14
QDCOUNT: Must be 1 in query; is 1 in reply (we echo the question)
15
ANCOUNT: As per the reply we get from the remote server (this number
16
will be stored in the cache)
17
NSCOUNT, ARCOUNT: Same as ANCOUNT