A real dig example.com, byte by byte. Its first section, the 12-byte header with every flag boxed, is the thing this lesson builds a parser for.
Before you start.Build Your Own DNS Server set out the build: a DNS server answers one question packet with one answer packet, over UDP, and every packet starts with a 12-byte header. This lesson covers the first two stages, because each is small: 01-udp opens the socket and proves bytes arrive, and 02-header reads the 12 bytes and answers with a header alone. A byte is a number from 0 to 255. A packet is a run of them, shown below in hexadecimal, so d0 is 208.
Lesson 39 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.