找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 文档 工具 设计
查看: 11|回复: 0

批处理设置DNS

[复制链接]

2万

主题

1501

回帖

3万

积分

超级版主

教育辅助界扛把子

附加身份标识
精华
1
热心
10
听众
1
威望
7
贡献
16915
违规
0
书币
55530
注册时间
2020-4-8

论坛元老灌水之王

发表于 2025-7-16 17:29 | 显示全部楼层 |阅读模式
批处理设置DNS,管理员权限运行,“以太网”根据实际更改,win10运行正常

@echo off
:start
echo 请输入数字选择DNS设置:
echo 1:自动
echo 2:阿里
echo 3:360
echo 4:腾讯
echo 5:114
echo 6:dnspod
echo 7:百度
echo 8:火山
set /P var=":"
if %var%==1 goto auto
if %var%==2 goto ali
if %var%==3 goto 360
if %var%==4 goto tengxun
if %var%==5 goto 114
if %var%==6 goto dnspod
if %var%==7 goto baidu
if %var%==8 goto huoshan
:auto
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip delete dns "以太网" all
ipconfig /flushdns
echo DNS设置为auto成功
echo ------------------------------------------
goto start
:ali
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 223.5.5.5 primary
netsh interface ip add dns name="以太网" 223.6.6.6 index=2
ipconfig /flushdns
echo DNS设置为阿里成功
echo ------------------------------------------
goto start
:360
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 101.226.4.6 primary
netsh interface ip add dns name="以太网" 218.30.118.6 index=2
ipconfig /flushdns
echo DNS设置为360成功
echo ------------------------------------------
goto start
:tengxun
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 119.28.28.28 primary
netsh interface ip add dns name="以太网" 182.254.118.118 index=2
ipconfig /flushdns
echo DNS设置为腾讯成功
echo ------------------------------------------
goto start
:114
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 114.114.114.114 primary
netsh interface ip add dns name="以太网" 114.114.115.115 index=2
ipconfig /flushdns
echo DNS设置为114成功
echo ------------------------------------------
goto start
:dnspod
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 119.29.29.29 primary
netsh interface ip add dns name="以太网" 182.184.2.2 index=2
ipconfig /flushdns
echo DNS设置为dnspod成功
echo ------------------------------------------
goto start
:baidu
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 180.76.76.76 primary
ipconfig /flushdns
echo DNS设置为百度成功
echo ------------------------------------------
goto start
:huoshan
cls
netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns name="以太网" dhcp
netsh interface ip set dns name="以太网" static 180.184.1.1 primary
netsh interface ip add dns name="以太网" 180.184.2.2 index=2
ipconfig /flushdns
echo DNS设置为火山成功
echo ------------------------------------------
goto start

Great works are not done by strength, but by persistence! 历尽艰辛的飞升者,成了围剿孙悟空的十万天兵之一。
相信我 学习就是不断的重复 不需要什么技巧
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则 需要先绑定手机号


免责声明:
本站所发布的第三方软件及资源(包括但不仅限于文字/图片/音频/视频等仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢某程序或某个资源,请支持正版软件及版权方利益,注册或购买,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To: admin@cdsy.xyz

QQ|Archiver|手机版|小黑屋|城东书院 ( 湘ICP备19021508号-1|湘公网安备 43102202000103号 )

GMT+8, 2025-7-19 14:02 , Processed in 0.043413 second(s), 26 queries .

Powered by Discuz! CDSY.XYZ

Copyright © 2019-2025, Tencent Cloud.

快速回复 返回顶部 返回列表