#Sets your local DNS settings to public DNS servers
$NICs = Get-WmiObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq “TRUE”}
Foreach($NIC in $NICs) {
$DNSServers = “4.2.2.2","8.8.8.8"
$NIC.SetDNSServerSearchOrder($DNSServers)
}
#Sets your local DNS settings with no static IP addresses
$NICs = Get-WMIObject Win32_NetworkAdapterConfiguration | where{$_.IPEnabled -eq “TRUE”}
Foreach($NIC in $NICs) {
$NIC.SetDNSServerSearchOrder()
}
No comments:
Post a Comment