Skip to content
Back to the catalog
Project dns-resolverNetworkingIntermediateComing soon

Build your own DNS resolver

Build a DNS resolver from scratch. Encode and parse UDP packets, then resolve domain names by walking the hierarchy from root servers.

Build it in your language

The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.

Guide language

The stage guides read in this language. Only languages this project is fully translated into show up here; the interface language does not change.

What this project is about

Project in preparation: we are completing and verifying the implementation path and its tests. The capabilities below describe the project goal; starting the project is not enabled yet.

Every time you type a URL, something translates a name into an IP address by walking a worldwide hierarchy of servers. That something fits in a few hundred lines.

Here you build DNS packets bit by bit, send them over UDP and parse the response, including the name compression that trips everyone up. You'll finish resolving real domains starting from the root servers, without leaning on the system resolver.

Roadmap

8 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.

  1. Phase 12 stages

    Writing a packet

    Build a DNS query byte by byte and send it over UDP.

  2. Phase 23 stages

    Reading the response

    Parse the header and sections, and decompress pointer-based names.

  3. Phase 32 stages

    Resolving for real

    Iterative walk from the root servers, CNAMEs and several record types.

  4. Phase 41 stage

    Caching

    Honour TTLs and avoid repeated lookups.

Before you start

A complete DNS resolver: packet serialization and parsing per RFC 1035, queries over UDP, support for the common record types (A, AAAA, CNAME, MX, NS, TXT), pointer-based name decompression, recursive resolution from the root servers, and caching that honours the TTL.

  • mcp-server
    Beta

    Build your own MCP server

    Build an MCP server from scratch. Implement Model Context Protocol with JSON-RPC, tools and resources to connect AI clients to your programs.

    Intermediate5 stages~12 hNetworking
    MCPJSON-RPCagents+1

    TypeScript · Python · Go

  • bittorrent
    Coming soon

    Build your own BitTorrent client

    Build a BitTorrent client from scratch. Decode bencode, contact trackers and download a real file through the peer-to-peer protocol.

    Advanced12 stages~20 hNetworking
    bencodeP2Pprotocols+1

    Go · Python · Java

  • http-server
    Coming soon

    Build your own HTTP server

    Build an HTTP server from scratch. Parse requests from socket bytes, manage connections and serve concurrent traffic with real HTTP responses.

    Intermediate10 stages~12 hNetworking
    socketsTCPHTTP+1

    Go · Python · C · Rust