Proxy a local DNS server with DoH

Hey, I’m trying to proxy my local Adguard Home server through Cloudflare Tunnel to have my own privat DNS (for my phone and maybe my family). I don’t want to open my firewall.
I have two main problems:

  1. The DNS server is accepting DoH with dig @<local ip> +https but not with curl -k -v -H 'accept: application/dns-message' 'https://<local ip>/dns-query?'. I think the Cloudflare Tunnel will do a normal HTTPS request like curl and this is not working. The server returns a ‘400 Bad Request’.
  2. When I proxy the server through the tunnel, dig is trying to first resolve the ip behind the domain and then it is making the request directly to the (I think) load balancer of Cloudflare. Because there is no domain in this request, the load balancer isn’t proxying the request and the connection dies. I did not try if Android is having the same issue, but I think so.

Is it possible to proxy DNS requests or is there a workaround?

I am using Cloudflare Tunnel in Docker. I think that is a limitation for a possible configuration.

Hi, I am having what I think is the same problem. I am trying to set up Adguard Home DoH and access it from the outside, but I too am having “Bad request” error. Did you find a solution to your issue ?