You might want to take a look at unbound as a recursive DNS server (further explaination on that in the Docs). Unbound also offers DoT or DoH, but there are currently no instructions for it on the Docs, but this is also a good guide for unbound (i suggest you mix and match it with the content of Pi-hole docs).
If you want to keep using DoH like with Cloudflared, there is dnscrypt-proxy.
Personally I wouldn't recommend DoH unless you explicitly need to obfuscate your DNS activity (or like Dan Schaper said: "DoH is a dirty, ugly hack that friends don't let friends use."), for just encryption DoT is preferred. I am using recursive unbound at home and unbound DoT with my travel router.
my unbound DoT
I use the config from Pi-hole docs withe the addition for DoT
Starting February 2, 2026, the cloudflared proxy-dns command will be removed from all new cloudflared releases.
(…)
Versions of cloudflared released before this date will not be affected and will continue to operate. However, note that our official support policy for any cloudflared release is one year from its release date.
Moving forward is there any kind of upgrade or drop in replacement for cloudflare doh? They mention something about a cloudflare WARP client - anything in the works?