mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: only set ::1 as DNS server on Windows if ipv6 available
This commit is contained in:
committed by
Cuong Manh Le
parent
8852f60ccb
commit
930a5ad439
@@ -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))
|
||||
return err
|
||||
}
|
||||
if ipVer == "ipv4" {
|
||||
if ipVer == "ipv4" && ctrldnet.SupportsIPv6ListenLocal() {
|
||||
// Disable IPv6 DNS, so the query will be fallback to IPv4.
|
||||
_, _ = netsh("interface", "ipv6", "set", "dnsserver", idx, "static", "::1", "primary")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user