Windows命令行设置IP地址和DNS服务器
- 设置IP地址为动态获取
netsh interface ip set address name="本地连接" source=dhcp
- 配置静态IP的命令
netsh interface ip set address name="本地连接" source=static addr=192.168.36.153 mask=255.255.255.0 gateway=192.168.36.1
- 设置DNS为动态获取
netsh interface ip set dns name="本地连接" source=dhcp
- 设置首选DNS服务器地址
netsh interface ip set dns name="本地连接" source=static addr=101.226.4.6 register=primary
- 设置备用DNS服务器地址
netsh interface ip add dns name="本地连接" addr=114.114.114.114 index=2