CMD 配置静态IP与DNS

时间:2024-01-19 16:34:26

配置静态IP与DNS

# 修改IP
netsh interface ip set address "网络连接" static IP地址 子网掩码 默认网关 # 修改DNS
netsh interface ip set dns "网络连接" static DNS地址
# 例子
netsh interface ip set address "本地连接" static 192.168.1.199 255.255.255.0 192.168.1.1 # 例子
netsh interface ip set dns "本地连接" static 8.8.8.8