DoH working with dig but not with curl


New Member
Hey, I set up DoH in Adguard Home with a valid certificat.
If I query the DNS server with
dig @<local ip> +https
it is working perfectly. The logs confirm the request and that it is indeed DoH.
If i query the DNS server with
curl -k -v -H 'accept: application/dns-message' 'https://<local ip>/dns-query?'
it is responding with a "400 Bad Request" error. I also tried "dns-json" as the header.

Does anyone know where I could find the error? Could it be my configuration or is my request in the wrong format?
I want to proxy the server to the internet and use it on my Android phone. By this, I need it to work with a regular http request like curl. If anyone had the same problem or is also using Cloudflare Tunnel, I would be happy to know your workaround.
Last edited: