m13253 / dns-over-https

High performance DNS over HTTPS client & server
https://developers.google.com/speed/public-dns/docs/dns-over-https
MIT License
1.96k stars 221 forks source link

What might go wrong with `unpacking error from upstream: dns: overflow unpacking uint16` ? #124

Closed PeterDaveHello closed 2 years ago

PeterDaveHello commented 2 years ago

Hi there,

I was trying to use "m13253/DNS-over-HTTPS" as a DoH client, and testing with various DoH servers, but there's one interesting thing is, with the simply local DoH server from dnscrypt-proxy, all the queries got SERVFAIL, and there will be some errors like:

2022/02/28 16:24:12 unpacking error from upstream https://doh.local/dns-query: dns: overflow unpacking uint16                                                 
2022/02/28 16:24:46 unpacking error from upstream https://doh.local/dns-query: dns: overflow unpacking uint16                                                 
2022/02/28 16:24:57 unpacking error from upstream https://doh.local/dns-query: dns: overflow unpacking uint16                                                 
2022/02/28 16:25:04 unpacking error from upstream https://doh.local/dns-query: dns: overflow unpacking uint16   

I'm no expert of DNS-over-HTTPS implementation or golang, do you know what might go wrong with this error, like maybe dnscrypt-proxy's DoH server doesn't fully implement IETF spec?

Many thanks!

m13253 commented 2 years ago

This error is generated by the DNS library I am using -- it receives an invalid DNS packet so it can't decode it.

However I don't want to spend too much effort into looking into this issue -- dnscrypt-proxy has a history of causing compatibility issues with m13253/DNS-over-HTTPS. Maybe you want to either use dnscrypt-proxy altogether, or use m13253/DNS-over-HTTPS altogether. You can also try some other combinations, for example, using the built-in DoH client in Windows, macOS, and iOS.

PeterDaveHello commented 2 years ago

Okay, didn't know the history, thanks for the explanation 😄

gdm85 commented 2 years ago

@PeterDaveHello feel free to search dnscrypt-proxy issue tracker for similar issues and pursue this upstream there.

Thanks!