Build Your Own DNS Server

The concierge story: your laptop asks one helper for an address and the helper walks the directory for you. That helper is a DNS server. This build writes one.
Before you start. This series builds a small DNS server, the program that turns a name like www.example.test into the number a computer needs to reach it. You need two ideas from the Networking track, refreshed here. DNS is the internet’s name directory: you ask it a name and it answers with an address (DNS Resolution). The question and the answer travel as short fixed-format packets, and DNS on the wire takes a real one apart byte by byte. Write the telegram yourself wrote the question side in Python. This build writes the side that answers. If Go is new to you, Enough Go to read these builds is an optional read first.
Code: teaching/code/from-scratch/dns/. One Go module, six stages, each a program you can run: go run ./01-udp up to go run ./06-forward. Each stage folder holds the files the earlier stages needed plus one or two new ones. Only the Go standard library, and the DNS bytes are built by hand: no DNS package. The real dig is the tester.