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.2

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.2
File Size Uploaded Provenance Actions
dosev-1.9.2.tar.gz 87.1 kB Without provenance Details for dosev-1.9.2.tar.gz

Built distribution (wheel)

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

Total release size: 145.5 kB

Release files / dosev-1.9.2.tar.gz

Download URL dosev-1.9.2.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
63b6314ae64888bf57b39d9d3d2745a4f11e6f52e2df32bb15e8a524196eb99f
BLAKE2b-256 checksum
How to use checksums
7d0153843239be114b6f95ccb8d89208202139fbb1edc5df38b6547c77274a6e
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.2-py3-none-any.whl

Download URL dosev-1.9.2-py3-none-any.whl
Size 58.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c50e46dfbd4bd8e48b16ea6015244077fdbe4a3fe28cc18df8b544d46599b23
BLAKE2b-256 checksum
How to use checksums
a9dc188ee0686a979d061224a26fef2864d6cbee7445af8779cd60e65d3b1bbf
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.2

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