设置客户端 DNS 地址:Set-DnsClientServerAddress

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 条评论

昵称

沙发空缺中,还不快抢~