mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
cmd/ctrld: only set ::1 as DNS server on Windows if ipv6 available
This commit is contained in:
@@ -52,7 +52,7 @@ func setPrimaryDNS(iface *net.Interface, dns string) error {
|
|||||||
mainLog.Error().Err(err).Msgf("failed to set primary DNS: %s", string(output))
|
mainLog.Error().Err(err).Msgf("failed to set primary DNS: %s", string(output))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if ipVer == "ipv4" {
|
if ipVer == "ipv4" && ctrldnet.SupportsIPv6ListenLocal() {
|
||||||
// Disable IPv6 DNS, so the query will be fallback to IPv4.
|
// Disable IPv6 DNS, so the query will be fallback to IPv4.
|
||||||
_, _ = netsh("interface", "ipv6", "set", "dnsserver", idx, "static", "::1", "primary")
|
_, _ = netsh("interface", "ipv6", "set", "dnsserver", idx, "static", "::1", "primary")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user