Read the project in dependency order:
src/name.rs — the foundational name invariant.src/packet.rs — types and bounded wire codec.src/zone.rs — tinydns source and authoritative lookup
semantics.src/cdb.rs — compiled compatibility format.src/server.rs — query validation, answer construction,
transport limits.src/client.rs — stub behavior and TCP fallback.src/axfr.rs — streaming zone movement and atomic
installation.src/dnscache_config.rs and
src/bin/dnscache.rs — iterative recursion, DNSSEC,
forwarding, access, and resource policy.src/rbl.rs, src/pick.rs,
src/wall.rs, and src/special.rs — specialized
responders.src/conf.rs, src/setuidgid.rs,
src/multilog.rs, and src/tai64.rs — deployment
and operations.The binaries in src/bin should then look thin. That is
intentional. They parse the command contract, load configuration, call a
library boundary, print diagnostics, and map fatal errors to the suite’s
exit convention.
Several rgbdns choices generalize beyond DNS.
Parse into valid types. If an invalid name can circulate as an ordinary string, every consumer must rediscover validation.
Bound dimensions independently. A packet byte limit does not replace a compression-depth limit; a cache byte limit does not replace a recursion-depth limit.
Separate policy from mechanism.
transport.rs owns bounded UDP and TCP mechanics while the
authoritative and specialized handlers own answer policy.
Compile mutable source into immutable serving data. This gives validation, atomic rollout, simple readers, and easy rollback.
Preserve protocol distinctions internally. A
Lookup enum prevents NXDOMAIN, NODATA, referral, and
refusal from collapsing into “no records.”
Run in the foreground. It composes with old and new supervisors and keeps signals understandable.
Treat compatibility files as hostile. Historical layout fidelity need not mean historical trust assumptions.