A very minimalist DNS-over-HTTPS proxy on Cloudflare Workers.
Sign up for a free Cloudlare Workers account, create a new worker, replace the Script with the content of 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 to set a default resolver. Confirmed to work with Cloudflare itself, Google, and NextDNS.
If you want to use the default resolver use https://<Cf_Workers_Adress> in your DoH client.
You can use a custom reselver using https://<Cf_Workers_Adress>/https://<Dns_resolver_of_your_choice> in your DoH client.
Tested resolver:
CloudFlare Security : https://<Cf_Workers_Adress>/https://security.cloudflare-dns.com/dns-query
NextDNS : https://<Cf_Workers_Adress>/https://dns.nextdns.io/<your_ID>
RethinkDNS : https://<Cf_Workers_Adress>/https://basic.bravedns.com/<Config_String>
GoogleDNS : https://<Cf_Workers_Adress>/https://dns.google/dns-query
ControlD : https://<Cf_Workers_Adress>/https://dns.controld.com/<Your_ID>
etc..
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. Daily request on free tier is limited to 100 thousands, should be enough for most personal use, or even a family.
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, so they can see your Cloudflare Worker address.