From 6e35cf93996507f1548b26f05dbb74181d918058 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Mon, 12 May 2025 12:34:22 +0800 Subject: [PATCH] fix: truncated UDP response in system dns https://github.com/MetaCubeX/mihomo/issues/2031 --- dns/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/client.go b/dns/client.go index 62fc12f9..abdad3a6 100644 --- a/dns/client.go +++ b/dns/client.go @@ -77,7 +77,7 @@ func (c *client) ExchangeContext(ctx context.Context, m *D.Msg) (*D.Msg, error) msg, _, err := c.Client.ExchangeWithConn(m, dConn) // Resolvers MUST resend queries over TCP if they receive a truncated UDP response (with TC=1 set)! - if msg != nil && msg.Truncated && c.Client.Net == "" { + if msg != nil && msg.Truncated && network == "udp" { tcpClient := *c.Client // copy a client tcpClient.Net = "tcp" network = "tcp"