Get-DnsClientServerAddress
获取当前客户端 DNS 地址,当前需要设置的有线网络接口的 InterfaceIndex 为 3;
Get-DnsClientServerAddress
InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
以太网 3 IPv4 {10.0.20.1, 10.0.20.2}
以太网 3 IPv6 {}
WLAN 2 21 IPv4 {}
WLAN 2 21 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
本地连接* 1 33 IPv4 {}
本地连接* 1 33 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
本地连接* 10 38 IPv4 {}
本地连接* 10 38 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
蓝牙网络连接 2 18 IPv4 {}
蓝牙网络连接 2 18 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Loopback Pseudo-Interface 1 1 IPv4 {}
Loopback Pseudo-Interface 1 1 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Set-DnsClientServerAddress
设置客户端 DNS 地址为 114.114.114.114, InterfaceIndex 为 3;
如果是多个,则配置为 -ServerAddresses ("114.114.114.114","8.8.8.8") ;
Set-DnsClientServerAddress -InterfaceIndex 3 -ServerAddresses ("114.114.114.114")
Get-DnsClientServerAddress
验证设置后的 DNS 地址,设置成功!
Get-DnsClientServerAddress
InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
以太网 3 IPv4 {114.114.114.114}
以太网 3 IPv6 {}
WLAN 2 21 IPv4 {}
WLAN 2 21 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
本地连接* 1 33 IPv4 {}
本地连接* 1 33 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
本地连接* 10 38 IPv4 {}
本地连接* 10 38 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
蓝牙网络连接 2 18 IPv4 {}
蓝牙网络连接 2 18 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3}
Loopback Pseudo-Interface 1 1 IPv4 {}
Loopback Pseudo-Interface 1 1 IPv6 {fec0:0:0:ffff::1, fec0:0:0:ffff::2, fec0:0:0:ffff::3
友情提示:本站所有文章,如无特殊说明或标注,均为何星星原创发布。与此同时,趋于近年来本站的文章内容频繁被他站盗用与机器采集,现已全局禁用网站文字内容操作,了解详情或转载文章请 点此 继续!
0 条评论