AdguardTeam / dnsproxy

Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
Apache License 2.0
2.37k stars 246 forks source link

handling tcp: unpacking msg: dns: buffer size too small - when I run and use DNS-over-TLS server #198

Open RiK621 opened 2 years ago

RiK621 commented 2 years ago

Hi! When I run and use DNS-over-TLS server with this options dnsproxy -l 192.168.0.106 --tls-port=853 --tls-crt=%cert path% --tls-key=%key path% -u 10.8.8.1:53 -p 53 --cache --cache-min-ttl=600 --ratelimit=10 --refuse-any -v -o /etc/dnsproxy/dnsproxy.log I see this errror in the logfile (no domain resolving) 2022/01/05 20:04:09 16057#15 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).handleTCPConnection(): handling tcp: started handling tls request from 192.168.0.100:55346 2022/01/05 20:04:09 16057#15 [error] handling tcp: unpacking msg: dns: buffer size too small

This error appears only with DNS-over-TLS server. There is no problem with standart unencrypted plain text resolver on port 53.

ameshkov commented 2 years ago

It just means that an invalid query is written by the client.

Please build it from this branch and try to reproduce the issue: https://github.com/AdguardTeam/dnsproxy/tree/test-198

It will log the actual message that it cannot unpack.