如何用命令自动设置电脑IP地址和DNS?
可以使用windows的netsh来完成
一、设置IP地址
1.自动获取IP:
netsh interface ipv4 set address name="本地连接" source=dhcp
2.指定IP地址:
netsh interface ipv4 set address name="本地连接" static 10.213.24.14 255.255.255.224 10.213.24.30
二.设置DNS
1.自动获取DNS
netsh interface ipv4 set dnsservers name="本地连接" source=dhcp
2.自定DNS
netsh interface ipv4 set dnsservers name="本地连接" static 10.213.1.208 primary
注意上面所有“本地连接”请用你要修改IP的本地连接名来替换,比如“本地连接1”