Skip to main content

Crate bluebox

Crate bluebox 

Source
Expand description

Bluebox - A fast DNS interceptor and cache.

Bluebox is a DNS server that intercepts DNS queries on the local network, caches responses, and blocks configured domains. It’s designed to be faster than your router’s DNS resolver.

§Architecture

The crate is organized into several modules:

  • config: Configuration loading and validation
  • dns: DNS protocol handling, blocking, and resolution
  • cache: Response caching with TTL support
  • network: Packet capture and construction
  • server: Server orchestration
  • error: Error types

§Testing

All components are designed with trait-based abstractions to enable comprehensive testing without network access:

use bluebox::dns::{Blocker, DnsResolver};
use bluebox::cache::DnsCache;

// Components can be tested with mock implementations
let blocker = Blocker::new(["*.ads.com"]);
assert!(blocker.is_blocked(&"tracking.ads.com".parse().unwrap()));

Re-exports§

pub use config::Config;
pub use error::Error;
pub use error::Result;

Modules§

blocklist
Blocklist format parsers.
cache
DNS response caching.
config
Configuration loading and validation.
dns
DNS-related modules.
error
Error types for the Bluebox DNS server.
metrics
Metrics initialization for Prometheus exporter.
network
Network-related modules for packet capture and construction.
server
DNS server orchestration.