High-Performance DoH Proxy

A Cloudflare Worker that proxies DNS-over-HTTPS requests with enhanced performance, reliability, and security

🚀 Your DoH Endpoint

Use this URL as your DNS-over-HTTPS resolver

https://high-performance-doh-proxy-worker.pirah3dev.workers.dev/dns-query

Lightning Fast

Leverages Cloudflare's global edge network for minimal latency and maximum performance.

🔄

Load Balancing

Intelligently distributes requests across multiple DNS providers based on configurable weights.

🛡️

Automatic Failover

Seamlessly switches to backup providers when primary ones experience issues.

📡 Supported DNS Providers

This proxy supports both general DNS providers and ad-blocking focused providers for enhanced privacy and security.

Cloudflare
20%
https://cloudflare-dns.com/dns-query
Google
15%
https://dns.google/dns-query
Quad9
15%
https://dns.quad9.net/dns-query
OpenDNS
10%
https://doh.opendns.com/dns-query
AdGuard
10%
https://dns.adguard.com/dns-query
Blocks ads, trackers, and malicious domains
ControlD
10%
https://freedns.controld.com/p2
Blocks ads and tracking domains
Mullvad
10%
https://adblock.dns.mullvad.net/dns-query
Blocks ads and trackers
NextDNS
10%
https://dns.nextdns.io/dns-query
Blocks ads, trackers, and malicious domains

🔧 Usage Examples

Use this worker as a DoH endpoint:

GET Requests

For GET requests, the DNS query must be base64url-encoded as per the RFC 8484 specification:

GET /dns-query?dns=<base64url-encoded-dns-query>

Why base64url encoding?

Detailed DNS Encoding Explanation

Example with curl:

curl "https://high-performance-doh-proxy-worker.pirah3dev.workers.dev/dns-query?dns=q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB"

POST Requests

For POST requests, the DNS query is sent as binary data in the request body:

POST /dns-query
Content-Type: application/dns-message
<binary-dns-query>

Example with curl:

curl -H "Content-Type: application/dns-message"
     --data-binary @query.dns
     https://high-performance-doh-proxy-worker.pirah3dev.workers.dev/dns-query

Using Without Base64 Encoding

To avoid base64 encoding entirely, use POST requests with the Content-Type: application/dns-message header. The DNS query is sent as raw binary data in the request body:

curl -H "Content-Type: application/dns-message"
     --data-binary @query.dns
     https://high-performance-doh-proxy-worker.pirah3dev.workers.dev/dns-query

Using with dig

dig @${new URL(dnsEndpoint).hostname} example.com

⚙️ Configuration

This worker automatically balances requests across multiple DNS providers based on the configured weights. All DNS responses are cached for 5 minutes to improve performance.

For CORS support, the worker includes the following headers in all responses:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Accept
Endpoint URL copied to clipboard!