我想做一个Windows 10批处理文件,从2个选项交换我的DNS。第一个是8.8.8.8(google dns),第二个是允许我观看美国netflix的自定义DNS(如90.90.90.90)。批处理文件,改变2ns之间的选项
bash命令来更改DNS是
netsh interface ipv4 add dnsserver "Ethernet" address=8.8.8.8 index=1
的命令查看DNS是否运行起来:
nslookup
现在我想要做的IF THEN ELSE这样的工作:
if (dns == 8.8.8.8)
then (change them to 90.90.90.90)
else (change them to 8.8.8.8)
即使是PowerShell脚本是好的
[5用于在Windows中更改DNS服务器的实用程序](http://helpdeskgeek.com/free-tools-review/5-utilities-changing-dns-servers-windows-reviewed/) – Cyrus
另请参阅http:// blogs.techne t.com/b/heyscriptingguy/archive/2009/02/26/how-do-i-query-and-retrieve-dns-information.aspx – lit
我曾经使用一个运行在任务托盘中的小程序,该程序已经预定义网络设置我可以选择。我只是不记得该程序的名称。我用了很多,因为我在农村学区工作,我在每所学校使用了不同的静态IP地址。如果我再次找到它,我会再回复。但我相信你也可以通过Google搜索。 – Squashman