This is one of the oldest vbscript example in the internet, similar/same examples alot from different sites. I got it from here
You change the dns server ip "("8.8.8.8", "8.8.4.4")", to your own isp dns/etc and save it to different script names eg. google.vbs, opendns.vbs etc.
I use it often, one for google and another one is my isp dns, so when one breakdown, I just double click the other dns script, and I can still surf the internet.🤣
Code
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNetCards = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objNetCard in colNetCards
arrDNSServers = Array("8.8.8.8", "8.8.4.4")
objNetCard.SetDNSServerSearchOrder(arrDNSServers)
NextYou change the dns server ip "("8.8.8.8", "8.8.4.4")", to your own isp dns/etc and save it to different script names eg. google.vbs, opendns.vbs etc.
I use it often, one for google and another one is my isp dns, so when one breakdown, I just double click the other dns script, and I can still surf the internet.🤣

