lazydns 0.2.31

A DNS server implementation in Rust, inspired by mosdns
Documentation

LazyDNS

Rust License: GPL-3.0 CI crates.io docs.rs codecov Dependabot Maintenance

🎯 Project Goal

Implement a Rust version of mosdns with 100% feature parity or better, featuring:

  • ✅ Full test coverage
  • ✅ Complete code documentation
  • 🚀 Superior performance through Rust's zero-cost abstractions
  • 🔒 Memory safety guarantees

📚 Documentation

🏃 Current Status:

  • DNS Protocol & Servers (UDP/TCP/DoT/DoH/DoQ)
  • Plugin System & Core Plugins
  • LazyCache with Stale-Serving - Background refresh cache with TTL support
  • Environment Variable Configuration - Runtime config via METRICS_ADDR, ADMIN_ADDR, etc.
  • Prometheus Monitoring - Metrics collection, health checks, and admin interface
  • Advanced Condition Matching - Flexible rule-based DNS query processing with 30+ matching plugins (Hosts, Domain, IP, GeoIP, GeoSite ...)
  • Caching with LRU eviction
  • Encrypted DNS (DoT RFC 7858, DoH RFC 8484, DoQ RFC 9250)
  • Multi-profile builds (minimal/full) with UPX compression
  • Documentation and Docker packaging

✨ Key Features (v0.2.31)

🚀 Intelligent Cache System

  • LazyCache with Stale-Serving: Background refresh cache with cache_ttl support for serving expired results during upstream failures
  • Performance: Significantly improved DNS resolution speed and cache hit rates
  • Metrics: Integrated Prometheus metrics for cache performance monitoring

📊 Comprehensive Monitoring

  • Prometheus Integration: Cache metrics, query statistics, and health checks
  • Admin Interface: Graceful shutdown and runtime configuration management

🎛️ Advanced Condition Matching

  • Flexible Rules: Support for qclass, rcode, has_cname, and complex rule combinations
  • Granular Control: Fine-tuned DNS traffic routing and filtering

⚙️ Environment Variable Configuration

  • Runtime Config: METRICS_ADDR, METRICS_ENABLED, ADMIN_ADDR, ADMIN_ENABLED
  • Deployment Friendly: Container-ready configuration via environment variables or .env files

🏗️ Optimized Build System

  • Multi-Profile: Minimal (<2MB) and full (<4MB) builds with UPX compression
  • Cross-Platform: Linux, macOS, Windows, FreeBSD across multiple architectures
  • Compact Binaries: Highly optimized Rust binaries for efficient deployment

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🙏 Acknowledgments

  • mosdns - The original inspiration
  • hickory-dns - Rust DNS library
  • The Rust community

📮 Contact