获取当前客户端 DNS 地址

当前有线网络接口的 InterfaceIndex 为 3;

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

重置当前客户端 DNS 地址

Set-DnsClientServerAddress -InterfaceIndex 3 -ResetServerAddresses

确认重置 DNS 结果状态

获取重置后有线网络接口 InterfaceIndex 为 3 的 DNS 已经恢复为系统默认!

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}

友情提示:本站所有文章,如无特殊说明或标注,均为何星星原创发布。与此同时,趋于近年来本站的文章内容频繁被他站盗用与机器采集,现已全局禁用网站文字内容操作,了解详情或转载文章请 点此 继续!

0 条评论

发表回复

Avatar placeholder

您的电子邮箱地址不会被公开。 必填项已用 * 标注