We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a92ca3 commit 0c1b427Copy full SHA for 0c1b427
CloudVeilService/Platform/WindowsDns.cs
@@ -30,13 +30,17 @@ public WindowsDns()
30
31
public void SetDnsForNic(string nicName, IPAddress primary, IPAddress secondary)
32
{
33
-
34
var ipVersion = "ipv4";
35
36
- if(primary.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
+ if(primary != null && primary.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
+ {
37
+ ipVersion = "ipv6";
38
+ }
39
+ else if (secondary != null && secondary.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
40
41
ipVersion = "ipv6";
42
}
43
+
44
var command = $"interface {ipVersion} add dnsservers \"{nicName}\" address=";
45
if (primary != null)
46
0 commit comments