How DNS encodes domain names: length-prefixed labels explained byte by byte
cneuralnetwork · x · 2026-10-22
Continuing his hand-rolled DNS resolver thread, @cneuralnetwork explains domain name encoding: names aren't sent as plain strings but as 06 google 03 com 00 — each label prefixed by its length byte, terminated by a zero.
A code screenshot shows the 12-byte DNS header followed by the question section with the encoded name, QTYPE=A and QCLASS=IN, as he constructs the query packet byte by byte.
Related event: Developer Builds a Mini DNS Resolver in C to Explain Domain Resolution(3 posts)→
More from coding & agent
- One-shot RL repro: training Qwen3.5-4B to paint watercolour flowers with a judge model — charles_irl · 2026-10-22
- Open-source Claude Duet alternative Open-Duet hits 5.9k stars on launch day — matchaman11 · 2026-10-22
- LGWM: A World Model That Verifies GUI Agent Transitions and Detects Hijacked Screens — Jiaming Zhang · 2026-10-22
- Tracing AI agents with OpenTelemetry: costs, P95 latency, and gaps in one pipeline — silksong_when · 2026-10-22
- New pattern: sync X bookmark folders to agents for intent-driven auto-pilot jobs — vincent_koc · 2026-10-22
- Towards AI builds writing benchmark: 4 LLM judges, 1000 human A/B tests on AI slop — AI Engineer · 2026-10-22