perf(dns): cache network capability check (#5244)

This commit is contained in:
Meow
2025-11-21 13:35:45 +08:00
committed by GitHub
parent 2185a730d2
commit 4956e65824
2 changed files with 64 additions and 16 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ func (c *Client) IsFinalQuery() bool {
// QueryIP sends DNS query to the name server with the client's IP.
func (c *Client) QueryIP(ctx context.Context, domain string, option dns.IPOption) ([]net.IP, uint32, error) {
if c.checkSystem {
supportIPv4, supportIPv6 := checkSystemNetwork()
supportIPv4, supportIPv6 := checkRoutes()
option.IPv4Enable = option.IPv4Enable && supportIPv4
option.IPv6Enable = option.IPv6Enable && supportIPv6
} else {