DNS: Everything

One real query and its answer, every field labelled. After six stages you can say which stage of the build produces or reads each box.
Before you start. This series has built a DNS server in six stages. By now it can do six things, one per earlier lesson:
- Receive one whole packet and send one back, over UDP (DNS 01 and 02: The UDP Socket and the Header).
- Read the 12-byte header, and set the right flags in the reply (same lesson).
- Read a question: a name written as counted labels, a type and a class (DNS 03 and 04: The Question and the Answer).
- Answer from a small zone, with the right reply for a name that exists, a name with no record of that type, and a name that does not exist (same lesson).
- Read names written as pointers, and decode a whole reply (DNS 05: Compressed Names).
- Ask another resolver for names it does not own, and relay the reply safely (DNS 06: A Forwarding Resolver).
This lesson adds no mechanism. It follows one question through all six, runs the whole server, and says what is missing.