使用批处理修改本地IP和DNS

2006-10-19 电脑网络 1339 阅读 0 评论

使用批处理修改本地IP和DNS
自动获取.bat:

@echo off
netsh interface ip set address name="本地连接" source=dhcp
ipconfig /flushdns

手动分配.bat:

@echo off
netsh interface ip delete dns "本地连接" addr=all
netsh interface ip add dns "本地连接" addr=202.97.224.69
netsh interface ip add dns "本地连接" addr=202.97.224.68
netsh interface ip add address "本地连接" 192.168.1.133 255.255.255.0
netsh interface ip add address "本地连接" gateway=192.168.1.1 gwmetric=2
ipconfig /flushdns


注:使用时复制上面的代码保存为bat文件,并更改其中的网络连接为你要修改的网卡名称(如:本地连接2 根据自身情况处理),IP和DNS修改为您自己的就OK了!

本文链接:https://blog.clang.cn/409.html

版权声明:转载请注明出处。

评论 (0)

评论已关闭