diff --git a/DnsServerSystemTrayApp/MainApplicationContext.cs b/DnsServerSystemTrayApp/MainApplicationContext.cs index 726e692e..7092f136 100644 --- a/DnsServerSystemTrayApp/MainApplicationContext.cs +++ b/DnsServerSystemTrayApp/MainApplicationContext.cs @@ -570,7 +570,7 @@ namespace DnsServerSystemTrayApp if (nic.OperationalStatus != OperationalStatus.Up) continue; - SetNameServerIPv6(nic, new IPAddress[] { }); + SetNameServerIPv6(nic, Array.Empty()); try { @@ -578,7 +578,7 @@ namespace DnsServerSystemTrayApp if (properties.GetIPv4Properties().IsDhcpEnabled) { - SetNameServerIPv4(nic, new IPAddress[] { }); + SetNameServerIPv4(nic, Array.Empty()); } else if (properties.GatewayAddresses.Count > 0) { @@ -586,7 +586,7 @@ namespace DnsServerSystemTrayApp } else { - SetNameServerIPv4(nic, new IPAddress[] { }); + SetNameServerIPv4(nic, Array.Empty()); } } catch (NetworkInformationException)