Skip to content

The crates

The Tadoru workspace has 23 crates and one binary, and each one has one job. The binary, tadoru, wires the crates together. One more crate, xtask, holds the release tasks and is not part of the server. This page says what each crate holds.

The direction of dependencies is a rule. A crate that parses or decides, such as dns-proto, depends on no crate that reads a socket or a file. That keeps the protocol code testable with plain bytes.

Crate Holds
crates/dns-proto The DNS wire format. No input or output, no async, and it never panics on network input
crates/core Shared types: cache keys, secrets, and password and token hashing
crates/cert-files Readers of certificate files: the trust store of the machine and a PKCS #12 file
crates/file-io File helpers: a write that no reader sees half of, a TOML date, the error of a file
crates/cache The bounded in-memory cache, sharded and synchronous
crates/blocklist Compiles lists, entries and pattern rules into what a query is tested against. Pure
crates/blocklist-sources Fetches a source and keeps the sets current: HTTPS, files and the timer
crates/zone The authoritative engine. It compiles a master file, then answers from it. Pure
crates/resolver The upstream client, retries and failover, the walk from the root, and DNSSEC validation
crates/config The configuration manager: the config root, revisions, the generations, the watcher and the write path
crates/state The SQLite stores but the query log, with the backup, the restore and the rewrite
crates/zone-store The zone files of the state root: the journals, the learned stubs and the zone clock
crates/sqlite-base What every SQLite store shares: the open and the migration of a file, and its error
crates/query-log The query log and its statistics: the writer, the folds, the reads, where the store runs
crates/pipeline The request pipeline that every transport shares
crates/server The transport adapters: UDP, TCP, DNS over TLS, DNS over HTTPS and DNS over QUIC
crates/http3-quic HTTP/3 on QUIC for the listeners: the glue of h3 on quinn, and its bounds. No DNS
crates/acme The certificate client: orders, challenges and renewal
crates/outbound The proxy client of the requests of the server: direct, HTTP or SOCKS5, on one socket
crates/console-files The built web console: the checks, the types, the policy, the file a path names. Pure
crates/tasks The long-running tasks that keep the zones, the resolver and the cache current
crates/front The listeners with their certificates and secrets, the update check, and the ACME glue
crates/api The management API, and the console files with its feature. It writes nothing itself
tadoru The binary. It wires the crates together, runs, and carries the command line
xtask The release tasks, run as cargo xtask. A tool of the repository: it ships nowhere

A pure crate does no input or output. It takes values in and gives values back.

crates/tasks holds the tasks that run for as long as the server does: the ANAME flattening and the refresh of learned names, NOTIFY, the zone clock and the expiry sweep, the negative trust anchors and the trust anchors of the root, the cache snapshots, the applier of the RFC 2136 updates with the zone checkpoints, the record prune and the cut of the write-ahead log of the account store. The binary starts each one, gives it what it reads and stops it. No crate but the binary and crates/front can depend on tasks, and it holds no listener and no route of the API.

crates/front holds the listeners with their certificates and secrets, the self-signed certificate of the node, the outbound routes, the update check, and the renewal of ACME with the wait of DNS-01 for its record. Only the binary depends on front.

All protocol logic is written in this repository. That covers the DNS wire codec, the resolver, the cache, the zone engine, DNSSEC validation and the blocking engine.

Proven libraries carry the rest. tokio runs the async work, rustls does TLS, quinn does QUIC, and hyper and axum serve HTTP. ring and RustCrypto give the cryptographic primitives. SQLite holds the state and the query log.

One crate, crates/config, writes the configuration files. The API never writes a configuration file itself. crates/config also holds the generations, projected.toml, the lists that the watcher owes and the snapshot that the server runs. Other crates hold what it once held: crates/file-io the write that no reader sees half of, crates/cert-files the reads of certificate files, crates/tasks the tasks that run beside the server, and crates/core the shared types. A secret never lives in a configuration file.

The files of the zones in the state root belong to crates/zone-store. crates/config calls the writes of a journal. The refresh task of crates/tasks writes what a stub zone learned, and the zone clock task of crates/tasks keeps the zone clock file. The route POST /api/zone-clock/resume of crates/api resumes a held zone clock, which writes that file, and the command line resumes a stopped one with the server stopped. The API and the binary also name zone_store to read those files.

Install and run says where each file lands. Backup and restore says which files an archive holds.