dnsbox 0.0.1

High-performance, zero-copy DNS message parsing and building for requests and responses, with broad RFC extension coverage.
Documentation
  • Coverage
  • 100%
    71 out of 71 items documented0 out of 38 items with examples
  • Size
  • Source code size: 34.5 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 556.3 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • KarpelesLab/dnsbox
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MagicalTux

dnsbox

CI crates.io docs.rs

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 — alloc and std are optional features.

Example

use dnsbox::{Header, Opcode};

let wire = [0x12, 0x34, 0x01, 0x00, 0, 1, 0, 0, 0, 0, 0, 0];
let header = Header::parse(&wire).unwrap();
assert_eq!(header.id, 0x1234);
assert_eq!(header.flags.opcode(), Opcode::QUERY);
assert!(header.flags.rd());

Minimum supported Rust version

Rust 1.89, edition 2024.

License

MIT — see LICENSE.