DNS 03 and 04: The Question and the Answer

The question as a telegram: the name spelled as counted chunks, and the answer’s name replaced by a “ditto”. This lesson builds the question’s chunks and, for the answer, the part that holds the address.
Before you start. DNS 01 and 02: The UDP Socket and the Header built a socket and a parser for the 12-byte header: an ID, a flags word, and four counts, the first of which says how many questions follow. The header says there is a question. This lesson reads it (stage 3) and then answers it with real addresses (stage 4). You also need one idea: a DNS record is one fact the directory holds, such as “this name has this address”.