TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
3.84k stars 400 forks source link

[Bug] DNS-Over-QUIC not work in debian12 #798

Closed lrinQVQ closed 4 months ago

lrinQVQ commented 7 months ago

Hey In the latest releases/develop branch , DNS Over QUIC can not work normally OS: Debian 12 Log:

[QUIC] System.OperationCanceledException: The operation was canceled. at System.Net.Quic.ValueTaskSource.TryComplete(Exception exception) at System.Net.Quic.ValueTaskSource.<>c.b__10_0(Object obj, CancellationToken cancellationToken) at System.Threading.CancellationTokenSource.ExecuteCallbackHandlers(Boolean throwOnFirstException) at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool) at System.Threading.TimerQueue.FireNextTimers() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart() --- End of stack trace from previous location --- at System.Net.Quic.ValueTaskSource.System.Threading.Tasks.Sources.IValueTaskSource.GetResult(Int16 token) at System.Net.Quic.QuicListener.PendingConnection.StartHandshake(QuicConnection connection, SslClientHelloInfo clientHello, Func`4 connectionOptionsCallback) at System.Net.Quic.QuicListener.PendingConnection.DisposeAsync() at System.Net.Quic.QuicListener.AcceptConnectionAsync(CancellationToken cancellationToken) at DnsServerCore.Dns.DnsServer.AcceptQuicConnectionAsync(QuicListener quicListener) in /root/TechnitiumSoftware/DnsServer/DnsServerCore/Dns/DnsServer.cs:line 723

ShreyasZare commented 7 months ago

Thanks for the post. The issue is not clear so please provide more details on your setup and how you are testing it.

lrinQVQ commented 7 months ago

I followed this guide to build&install the DNS server https://github.com/TechnitiumSoftware/DnsServer/blob/master/build.md Test in DnsServer commit: develop https://github.com/TechnitiumSoftware/DnsServer/commit/e8c9122d0c76fa4b7058414b40faf0c8513f7ce0 / releases https://github.com/TechnitiumSoftware/DnsServer/commit/844410831092f54f604529fb1437e989566a01e2 TechnitiumLibrary commit: develop https://github.com/TechnitiumSoftware/TechnitiumLibrary/commit/6ef9df923a59f0a0bc2c8362fe336421d4f08134 / releases https://github.com/TechnitiumSoftware/TechnitiumLibrary/commit/7bc6ae603e47b013c1c331926ca4095d6e9c3fbe dotnet-sdk-7.0 from Microsoft Software Repository libmsquic commit: develop https://github.com/microsoft/msquic/commit/7ff58fed64533cb10e86fe14b0d23b1c2eda0e58 / releases from Microsoft Software Repository

I use for recursive dns, enable dot, doh, doq, use ecc ssl certificate and Enables recursion to allow this DNS Server to resolve any domain name, disable Blocking my server has 3 ipv4 and 3 ipv6 udp port 853 of all IPs is not occupied by other services netstat -apn | grep 853 show udp6 853 is listener, no udp(ipv4) 853 listener (same with UDP 443) 1

Then I tested my DNS at https://dnsclient.net/ Doh, DoT, Plain, TCP is work, H3, QUIC no response

ShreyasZare commented 7 months ago

Thanks for the details.

DnsServer commit: develop e8c9122 / releases 8444108

Always use the master branch since develop branch cannot be guaranteed to work due to partial code commits.

show udp6 853 is listener, no udp(ipv4) 853 listener (same with UDP 443)

This is normal since those sockets have DualMode enabled which will allow to work with IPv4 too.

Overall, the setup looks good. I would suggest that you use tcpdump to ensure that the UDP packets for port 853 are indeed being received when you test.

If nothing works then I would suggest that you use the dotnet and libmsquic binaries instead of building them yourself and see if that works.

lrinQVQ commented 7 months ago

Thanks for your reply,

If nothing works then I would suggest that you use the dotnet and libmsquic binaries instead of building them yourself and see if that works.

I switched dotnet & libmsquic to the Microsoft repository version and build master branch, the problem still exists

Overall, the setup looks good. I would suggest that you use tcpdump to ensure that the UDP packets for port 853 are indeed being received when you test.

I try using tcpdump to analyze what happened, but everything looks fine 2

ShreyasZare commented 7 months ago

Thanks for the details. I am running DoQ on Debian 11 and is working fine. If possible, do try on another distro and see if that is working. Note that QUIC is quite nascent protocol and thus the libraries (libmsquic) may still have issues on some platforms.