/doh-cf-pages

DNS-over-HTTPS proxy on Cloudflare Pages

Primary LanguageJavaScriptBSD Zero Clause License0BSD

doh-cf-pages

A very minimalist DNS-over-HTTPS proxy on Cloudflare Pages.

Clone this repo on your own GitHub account, sign up for a free Cloudflare Pages account, create a new project, connect to GitHub, choose your cloned project and you're done. Use the address anywhere DoH is accepted (AdGuard, browsers secure DNS settings, YogaDNS, Intra, Nebulo etc). When a path is needed, use the testpath branch that will deploy to youraddress.pages.dev/dns-query

Feel free to replace the doh variable inside index.js with any DNS-over-HTTPS server you want. Confirmed to work with Cloudflare itself, Google, and NextDNS. The rarely supported JSON API is available through the dohjson variable. Some providers use identical URL (Cloudlfare, NextDNS), some use /resolve instead of /dns-query for path (Google, AdGuard).

Why? In case ISPs start banning known DoH providers, you can use your own proxy. Even if they block pages.dev wholesale, you can use your own domain, either hosted on Cloudflare, or any provider with CNAME record, including free subdomains from FreeDNS (free account must login once each 6 months to maintain subdomain). Daily request on free tier is limited to 100 thousands, should be enough for most personal use, or even a family.

This project is based on my doh-cf-workers, the difference is while you don't even need a GitHub account on the Workers version, custom domain must be hosted on Cloudflare.