dnsbox
High-performance DNS message parsing and building for Rust — queries and
responses, zero-copy, no_std, with broad RFC extension coverage (EDNS(0),
DNSSEC, SVCB/HTTPS, TSIG, and more).
Status: early development. The API is not stable and most of the functionality is still on the roadmap.
Goals
- Safe on hostile input — no panics, no out-of-bounds reads,
#![forbid(unsafe_code)]. - Zero-copy parsing — messages are views over your buffer; names and record data decode lazily.
- Fast building — write straight into a caller-supplied buffer with name compression and truncation handled for you.
no_std—allocandstdare optional features.
Example
use ;
let wire = ;
let header = parse.unwrap;
assert_eq!;
assert_eq!;
assert!;
Minimum supported Rust version
Rust 1.89, edition 2024.
License
MIT — see LICENSE.