Skip to main content

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 _tr_ust anchor updates, negative caching, optimistic caching (serve‑stale), blocklists, hosts overrides, upstream failover, rate limiting, rebinding protection, Prometheus metrics, and more.

🚀 Quick Start

# Install via pip
pip install dosev

# On first run, a default configuration file is created in the OS‑specific user config directory:
#   Linux:   ~/.config/dosev/dosev.conf
#   macOS:   ~/Library/Application Support/dosev/dosev.conf
#   Windows: %APPDATA%\dosev\dosev.conf
# Edit it to your needs, then start the server:
dosev

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). Includes KeyTrap mitigation (CVE‑2023‑50387).
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.
Upstream selection Multiple strategies: failover (try in order), parallel (query all, return first success), random, roundrobin.
Rate limiting Token‑bucket limiter per client IP.
Rebinding protection Strip or block private IP addresses from responses.
Cache poisoning prevention Scrub unsolicited NS records (RFC 2181, CVE‑2025‑11411).
Metrics Prometheus‑compatible metrics (requests, errors, latency).
Privilege dropping Drop root privileges after binding to privileged ports.
Cross‑platform Works on Linux, macOS, and Windows.
Configuration Single INI file; auto‑generated with comments on first run.

📖 Documentation


🔧 Configuration Example

#
# dosev configuration file
# Paths can be absolute or relative to the directory where dosev is started.
#

[server]
listen_ip = 0.0.0.0
listen_port = 53

[resolver]
verbose = false
disable_ipv6 = false
dns_ecs_enabled = true
dns_max_payload = 4096

[upstreams]
# List your upstreams here. Each upstream is defined in its own section.
servers = cloudflare,google

[upstreams.cloudflare]
address = 1.1.1.1
protocol = udp
ip = 1.1.1.1          # optional fixed IP to skip resolution

[upstreams.google]
address = dns.google
protocol = https
port = 443
hostname = dns.google
doh_version = auto
# no 'ip' – will be resolved via bootstrap DNS

[bootstrap]
servers = 1.1.1.1:53,8.8.8.8:53

[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

📄 License

MIT © 2026 Mohammad Amin Kiani


🙏 Acknowledgements

Metadata

Release files for dosev 1.9.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dosev 1.9.4
File Size Uploaded Provenance Actions
dosev-1.9.4.tar.gz 87.2 kB Without provenance Details for dosev-1.9.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dosev 1.9.4
File Interpreter ABI Platform Actions
dosev-1.9.4-py3-none-any.whl Python 3 none any Details for dosev-1.9.4-py3-none-any.whl

Total release size: 145.6 kB

Release files / dosev-1.9.4.tar.gz

Download URL dosev-1.9.4.tar.gz
Size 87.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e4fa550214c5355f08fcc263e56edd993c77404a8f3bbb1e8135464e046eb499
BLAKE2b-256 checksum
How to use checksums
bdbe8ce93972a25c986783db3f60815df0edda6e302eec675c82a6b7c4a39174
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / dosev-1.9.4-py3-none-any.whl

Download URL dosev-1.9.4-py3-none-any.whl
Size 58.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c99fd0706f4d8d90818fb8972fd87f4eb79fe4e784148fecd33a5307144cc41
BLAKE2b-256 checksum
How to use checksums
b6cf7a79a30832955d162e5edce58dccab6d4cc282a225885e3769f26ee9110b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for dosev 1.9.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page