Windows删除DNS服务器

前端之家收集整理的这篇文章主要介绍了Windows删除DNS服务器前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个行为不端的DNS服务器.

我的一些Windows机器只有2个DNS服务器

  1. server01 192.0.2.1
  2. server02 192.0.2.2

我的一些Windows机器有3个dns服务器

  1. server01 192.0.2.1
  2. server02 192.0.2.2
  3. server03 192.0.2.3

如何使用PowerShell从我的DNS设置中删除server03(192.0.2.3)?

  1. PS C:\Windows\system32> Get-DnsClientServerAddress
  2.  
  3. InterfaceAlias Interface Address ServerAddresses
  4. Index Family
  5. -------------- --------- ------- ---------------
  6. Ethernet 2 12 IPv4 {192.0.2.1,192.0.2.2,192.0.2.3}
  7. Ethernet 2 12 IPv6 {}
  8. Loopback Pseudo-Interface 1 1 IPv4 {}

我的窗户经验非常少.在linux上,我会编辑resolv.conf

更新这些是Windows 2012 R2服务器

http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/28/use-powershell-to-configure-static-ip-and-dns-settings.aspx
  1. $wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'"
  2. $DnsServers = "192.0.2.1","192.0.2.2"
  3. $wmi.SetDNSServerSearchOrder($DnsServers)

猜你在找的Windows相关文章