Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the difference between the DOH POST request sent by DOG and by Q? #76

Closed
fxzxmic opened this issue Nov 12, 2023 · 2 comments
Closed

Comments

@fxzxmic
Copy link

fxzxmic commented Nov 12, 2023

I created a simple DOH forwarding myself, but found that using DOG and Q's GET mode worked fine, but using Q's POST mode would return a 500 error. What is the reason for this?

@fxzxmic
Copy link
Author

fxzxmic commented Nov 12, 2023

I found the reason: the way Q sends POST requests is not accepted by mainstream DOH servers.

$ q @https://cloudflare-dns.com/dns-query github.com A --http-method=POST
FATA[0000] got status code 415 from https://cloudflare-dns.com:443/dns-query?dns=oXsBAAABAAAAAAAABmdpdGh1YgNjb20AAAEAAQ 
$ q @https://dns.google/dns-query github.com A --http-method=POST
FATA[0000] got status code 400 from https://dns.google:443/dns-query?dns=APcBAAABAAAAAAAABmdpdGh1YgNjb20AAAEAAQ

natesales added a commit that referenced this issue Dec 13, 2023
@natesales
Copy link
Owner

Indeed! Fixed in v0.16.0

~ ▴ q -V
https://github.com/natesales/q version 0.16.0 (7feffa12d62cbe9dd0fc71138c54daebd7b6748e 2023-12-13T04:54:44Z)
~ ▴ q @https://cloudflare-dns.com/dns-query github.com A --http-method=POST
github.com. 15s A 140.82.114.4
~ ▴ q @https://dns.google/dns-query github.com A --http-method=POST
github.com. 1m A 140.82.112.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants