Skip to main content

Multi‑protocol DNS resolver with full server and config support

Project description

dosev – Multi‑Protocol DNS Resolver & Server

CI PyPI version License: MIT

dosev is a high‑performance, asynchronous DNS resolver and forwarding server that speaks all major DNS protocols – both as a client and as a server.

  • Client protocols: DNS over UDP, TCP, TLS (DoT), HTTPS (DoH – HTTP/1.1, HTTP/2, HTTP/3), and QUIC (DoQ).
  • Server protocols: UDP, TCP, TLS (DoT), HTTPS (DoH – HTTP/2 and HTTP/3).
  • Features: EDNS0 (including Client Subnet), DNSSEC validation with automatic trust anchor updates, negative caching, optimistic caching (serve‑stale), blocklists, hosts overrides, upstream health checks, load balancing, Prometheus metrics, and more.

🚀 Quick Start

# Install via pip
pip install dosev

# Create a minimal config file
mkdir -p config
cat > config/dosev.conf <<EOF
[server]
listen_ip = 0.0.0.0
listen_port = 53

[resolver]
upstream_dns = 1.1.1.1
protocol = udp
EOF

# Start the server
dosev --config config/dosev.conf

For detailed instructions, see the Quick Start Guide.


✨ Features

Feature Description
Multi‑protocol client Forward queries via UDP, TCP, TLS, HTTPS (HTTP/1.1, HTTP/2, HTTP/3), and QUIC.
Multi‑protocol server Listen on UDP, TCP, TLS, and HTTPS (HTTP/2 & HTTP/3).
DNSSEC validation Validate responses with a built‑in root trust anchor (auto‑updated from IANA).
Caching Positive and negative caching with configurable TTLs; optimistic caching (serve‑stale).
Blocklists Filter domains using local files or remote lists (automatically refreshed).
Hosts overrides Custom A/AAAA records for local name resolution.
EDNS0 & Client Subnet Pass client subnet to upstreams for geo‑optimised responses.
Load balancing & health checks Distribute queries across multiple upstreams; automatically exclude unhealthy ones.
Rate limiting Token‑bucket limiter per client IP.
Rebinding protection Strip or block private IP addresses from responses.
Metrics Prometheus‑compatible metrics (requests, errors, latency, cache stats).
Privilege dropping Drop root privileges after binding to privileged ports.
Cross‑platform Works on Linux, macOS, and Windows.
Configuration Single INI file; can be reloaded without restarting.

📖 Documentation


🔧 Configuration Example

[server]
listen_ip = 0.0.0.0
listen_port = 53

[resolver]
upstream_dns = 1.1.1.1
protocol = udp

[security]
dnssec_enabled = true
auto_update_trust_anchor = true

[blocklists]
enabled = true
urls = https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
action = NXDOMAIN

See the full configuration reference for all options.


🧪 Running Tests

pip install dosev[test]
pytest --cov=dosev --cov-report=term-missing

🤝 Contributing

We welcome contributions! Please read our Contributing Guide before opening issues or pull requests.


📄 License

This project is licensed under the MIT License – see the LICENSE file for details.


🙏 Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dosev-1.3.0.tar.gz (50.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dosev-1.3.0-py3-none-any.whl (39.6 kB view details)

Uploaded Python 3

File details

Details for the file dosev-1.3.0.tar.gz.

File metadata

  • Download URL: dosev-1.3.0.tar.gz
  • Upload date:
  • Size: 50.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dosev-1.3.0.tar.gz
Algorithm Hash digest
SHA256 e26ef1b7313620756ffd96a01798950ffef9171b256fb8088456b67aa589882d
MD5 04d59109fa7888ae1aea04508de51b59
BLAKE2b-256 a14acda4c01da72353b8f7b8db3cdbc246b5c7f4ed10f49daf4e2a755c53a101

See more details on using hashes here.

File details

Details for the file dosev-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: dosev-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 39.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for dosev-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3fc0959d72a3f438697e3ceba9920e17ad22d39994ab9e30feeb26d2b1e0d5e
MD5 056ee8637b06231e9c51703d685bc0c0
BLAKE2b-256 15a4f55c20218a863e56ec828c2c335a2767811a4a2047838401723d11890b5a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page