admin 发表于 2019.10.17 00:36

使用批处理 bat 修改windows 7 系统的DNS服务器地址

使用批处理 bat 修改windows 7 系统的DNS服务器地址

@echo off
echo **************************************************************************
echo *                           修改IP地址、DNS                            *
echo *                      Windows 7 Copyright (C) 2016-01-12                *
echo **************************************************************************
echo 正在修改DNS服务器地址,请耐心等待…………
echo 正在添加本机首选DNS服务器...
netsh interface ipv4 set dns name="本地连接" source=static addr=8.8.8.8 register=PRIMARY
netsh interface ipv4 set dns name="本地连接 1" source=static addr=8.8.8.8 register=PRIMARY
netsh interface ipv4 set dns name="本地连接 2" source=static addr=8.8.8.8 register=PRIMARY
netsh interface ipv4 set dns name="本地连接 3" source=static addr=8.8.8.8 register=PRIMARY
netsh interface ipv4 set dns name="本地连接 4" source=static addr=8.8.8.8 register=PRIMARY
echo 正在添加备用DNS服务器...
netsh interface ipv4 add dns name="本地连接" addr=119.29.29.29
netsh interface ipv4 add dns name="本地连接 1" addr=119.29.29.29
netsh interface ipv4 add dns name="本地连接 2" addr=119.29.29.29
netsh interface ipv4 add dns name="本地连接 3" addr=119.29.29.29
netsh interface ipv4 add dns name="本地连接 4" addr=119.29.29.29
echo 检查当前本机配置...
ipconfig/flushdns
ipconfig /all
echo >.\hercd.url
echo URL="https://bbs.mfpud.com/" >>.\hercd.url
hercd.url
del hercd.url
exit



页: [1]
查看完整版本: 使用批处理 bat 修改windows 7 系统的DNS服务器地址