Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tina-hello authored Jul 20, 2023
1 parent aea7e43 commit f658f45
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# doh-cf-workers
A very minimalist DNS-over-HTTPS proxy on Cloudflare Workers.
A very minimalist DNS-over-HTTPS proxy on Cloudflare Workers that randomly pick a server using the OISD list. I don't think there's actually any point for someone to use this, for starters you're probably better off just picking one of the servers since the subtle behavior differences between the servers might make debugging harder. For a blocked domain, DNSWarden, ControlD, and RethinkDNS return a null address with one hour, one minute, and 5 minutes TTL respectively, while AhaDNS responds with REFUSED.

Sign up for a free [Cloudflare Workers](https://workers.cloudflare.com/) account, create a new worker, replace the Script with the content of [index.js](/index.js), deploy the worker, and you're done, use the address anywhere DoH is accepted (AdGuard, browsers secure DNS settings, YogaDNS, Intra, Nebulo etc). Feel free to replace the `doh` variable with [any DNS-over-HTTPS server you want](https://github.com/curl/curl/wiki/DNS-over-HTTPS). Confirmed to work with Cloudflare itself, Google, and NextDNS. The rarely supported [JSON API](https://developers.google.com/speed/public-dns/docs/doh/json) 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 workers.dev wholesale, you can use your own domain (it must be hosted on Cloudflare, add a CNAME record targeting anything and bind the route from your website Workers tab). If you want to use domain not hosted on Cloudflare, use [doh-cf-pages](https://github.com/tina-hello/doh-cf-pages) instead, where even CNAME records from [FreeDNS](https://freedns.afraid.org/) is enough for custom domain.

Daily request on free tier is limited to 100 thousands, should be enough for most personal use, or even a family. If you need more, upgrade to paid plan (card needed) and edit the [wrangler.toml](/wrangler.toml), though with minimum $5 monthly you might be better off just hosting AdGuard Home on a proper VPS ($5 on Vultr, pretty much unlimited request) which you can also put behind Cloudflare to hide your VPS IP. Once Cloudfare Snippet is released and if it's available on free tier, the code will be updated to adopt it for unlimited daily request.

You can also deploy the project using the button below, useful if you want to quickly modify the parameter/code without manually deploying to Cloudflare. Keep in mind the Action logs are visible to public unless you make your repository private (you'll need to [unfork](https://stackoverflow.com/questions/38831301/how-to-un-fork-the-github-repository)), so anyone can see your Cloudflare Worker address. Remember to remove the logs after deploying if you leave the repository public unless you're OK with others using your daily request quota.

[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/tina-hello/doh-cf-workers)

Want more control of the filter? Use [serverless-dns](https://github.com/serverless-dns/serverless-dns) which powers [RethinkDNS](https://rethinkdns.com/)

Want to host on Google Cloud Function or see how this is implemented in .NET? Use my [doh-gcf](https://github.com/tina-hello/doh-gcf)
I also can't get the Deploy button to work specifically for a branch, and since I don't think this warrant its own repo, I'll just leave it here as a proof of concept. Note that the workflow works too, so if you manually run the workflow from the Action tab after using the Deploy button on the main branch, and then pick this branch, you'll get a separate Workers instance that uses the random OISD logic.

0 comments on commit f658f45

Please sign in to comment.