Skip to content
rrchelbiPublic

About

A fast, lightweight DNS server written in Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apex

A DNS server built from scratch in Rust.

what it does

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.

quick start

git clone https://github.com/rrchelbi/apex
cd apex
cargo run

Server 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 MX

To see the full resolution trace:

RUST_LOG=debug cargo run
INFO 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 }

build

cargo build --release          # target/release/apex
cargo install --path .         # install globally

stack

crate why
anyhow error propagation
tracing structured logging
tracing-subscriber RUST_LOG filtering

status

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

license

MIT

About

A fast, lightweight DNS server written in Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages