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”.
Lesson 40 of 117 in From Scratch
The rest of this lesson is part of a plan.
A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.