A DNS server built from scratch in Rust.
Parses raw DNS packets from the wire, resolves queries recursively, and responds — no dependencies on system resolvers.
Built on top of a hand-rolled byte buffer parser that speaks RFC 1035 directly.
git clone https://github.com/rrchelbi/apex
cd apex
cargo runServer binds to 0.0.0.0:2053 by default.
To test it:
dig @127.0.0.1 -p 2053 google.com
dig @127.0.0.1 -p 2053 google.com AAAA
dig @127.0.0.1 -p 2053 gmail.com MXTo see the full resolution trace:
RUST_LOG=debug cargo runINFO apex: listening on 0.0.0.0:2053
INFO apex: received query: DnsQuestion { name: "google.com", qtype: A }
DEBUG apex: looking up A google.com via 198.41.0.4
DEBUG apex: looking up A google.com via 216.239.34.10
DEBUG apex: answer: A { domain: "google.com", addr: 142.250.185.46, ttl: 207 }cargo build --release # target/release/apex
cargo install --path . # install globally| crate | why |
|---|---|
anyhow |
error propagation |
tracing |
structured logging |
tracing-subscriber |
RUST_LOG filtering |
early stage. currently handles:
- zero-copy wire format parser and serializer
- A, AAAA, NS, CNAME, MX record support
- recursive resolution from root servers
- unknown record passthrough
- TTL caching
- concurrent query handling
- authoritative mode / zone files
- DoT / DoH
MIT