This commit is contained in:
patterniha 2025-05-07 05:20:07 +03:30
parent a81a8fee84
commit 67d0a2df71
2 changed files with 9 additions and 9 deletions

View file

@ -37,7 +37,7 @@ type Client struct {
timeoutMs time.Duration
finalQuery bool
ipOption *dns.IPOption
useSystem bool
checkSystem bool
}
// NewServer creates a name server object according to the network destination url.
@ -187,7 +187,7 @@ func NewClient(
timeoutMs = time.Duration(ns.TimeoutMs) * time.Millisecond
}
useSystem := ns.QueryStrategy == QueryStrategy_USE_SYS
checkSystem := ns.QueryStrategy == QueryStrategy_USE_SYS
client.server = server
client.skipFallback = ns.SkipFallback
@ -200,7 +200,7 @@ func NewClient(
client.timeoutMs = timeoutMs
client.finalQuery = ns.FinalQuery
client.ipOption = &ipOption
client.useSystem = useSystem
client.checkSystem = checkSystem
return nil
})
return client, err
@ -217,7 +217,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.useSystem {
if c.checkSystem {
supportIPv4, supportIPv6 := checkSystemNetwork()
option.IPv4Enable = option.IPv4Enable && supportIPv4
option.IPv6Enable = option.IPv6Enable && supportIPv6