命令行修改本地IP地址和DNS服务器地址
作者:互联网
netsh interface show interface //查看网卡名字
netsh interface ipv4 set address name="Ethernet0" static 192.168.126.138 255.255.255.0 192.168.126.2 //设置静态IP
netsh interface ip set dns “Ethernet0” static 119.29.29.29 //设置主DNS
netsh interface ip add dns “Ethernet0” 8.8.8.8 index=2 //设置备用DNS
netsh interface ip set address name="Ethernet0" source=dhcp //设置自动获取IP地址
netsh interface ip set dns name="Ethernet0" source=dhcp //设置自动DNS
参考链接:
1、在Win10中手动添加/修改本地IP https://zhuanlan.zhihu.com/p/366445441
2、Windows下使用命令行设置ip地址的DNS服务器 https://www.cnblogs.com/freeweb/p/5061025.html
3、CMD命令更改IP地址三招 https://blog.51cto.com/dawoniu/144342
标签:set,netsh,ip,Ethernet0,DNS,IP地址,interface,服务器 来源: https://www.cnblogs.com/Wikix/p/16351011.html