1 Star 0 Fork 0

molay/tinyTools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
change_host.txt 6.45 KB
一键复制 编辑 原始数据 按行查看 历史
molay 提交于 2017-10-12 10:38 . 更新 change_host.txt
@rem 项目是域名解析到网关机器,做分发。调试的是,有时候要各自服务器都看看。就需要手动更改hosts文件。
@rem 使用bat文件,方便更改hosts文件
@echo off
@echo "请注意你的杀毒软件提示,一定要允许"
@echo ########################################
@echo 请选择要指定的ip地址
@echo 0、退出
@echo 1、139.196.253.146(国内网关)
@echo 2、139.196.253.144
@echo 3、139.196.153.151
@echo 4、47.88.85.96(美国网关)
@echo 5、47.88.86.91
@echo 6、47.88.84.80
:CHOOSE
set /p choice=
if %choice%==0 (
exit
)
set /a choice=%choice%+0
if %choice% GTR 0 (
if %choice% LEQ 6 (
@xcopy C:\Windows\system32\drivers\etc\hosts C:\Windows\system32\drivers\etc\hosts.bak\ /d /c /i /y
@echo ########################################
@echo hosts文件备份完毕,开始修改hosts文件
@rem ==============start=====================
@rem ==============start=====================
@rem ==============start=====================
if %choice%==1 (
@echo 139.196.253.146 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.146 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)else if %choice%==2 (
@echo 139.196.253.144 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.253.144 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)else if %choice%==3 (
@echo 139.196.153.151 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 139.196.153.151 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)else if %choice%==4 (
@echo 47.88.85.96 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.85.96 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)else if %choice%==5 (
@echo 47.88.86.91 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.86.91 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)else if %choice%==6 (
@echo 47.88.84.80 act.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 cp.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 captcha.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 www.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 ddusys.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 cn.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 passport.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 search.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
@echo 47.88.84.80 exhibition.drugdu.com >>C:\Windows\System32\drivers\etc\hosts
)
@rem ==============end=====================
@rem ==============end=====================
@rem ==============end=====================
@echo "hosts文件修改完成"
@ipconfig /flushdns
@echo "刷新DNS完成"
@echo hosts文件修改完毕,按任意键恢复系统原始状态
@echo
@echo ########################################
@pause > nul
@copy C:\Windows\System32\drivers\etc\hosts.bak\hosts C:\Windows\System32\drivers\etc\hosts /y
@echo
@echo off
echo hosts文件恢复完毕,按任意键退出
@echo
@pause > nul
@exit
)else (
echo 输入有误2,请重新输入
goto CHOOSE
)
echo a
goto CHOOSE
) else (
echo 输入有误1,请重新输入
goto CHOOSE
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/molay/tinyTools.git
git@gitee.com:molay/tinyTools.git
molay
tinyTools
tinyTools
master

搜索帮助