设置DNS setttings 2

问题描述:

我试试,树莓派2使用PowerShell设置在Windows 10 DNS设置:设置DNS setttings 2

Set-DNSClientServerAddress –InterfaceIndex <number> -ServerAddresses DNS1-IP,DNS2-IP 

但我收到以下错误:

The term 'Set-DNSClientServerAddress' is not recognized as the name of a cmdlet CommandNotFoundException

如何成功完成DNS设置?

谢谢您的关注。

请回答。

我没有试过Windows 10的IoT版本,但可能Powershell cmdlet是有限的?

但是,你也可以尝试设置DNS using the Get-WmiObject cmdlet

$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'" 
$wmi.SetDNSServerSearchOrder('DNS1-IP','DNS2-IP')