赞
踩
WIN + R
打开下方框框,输入“C:\Windows\System32\drivers\etc
”:
根据下图3步操作,以管理员身份运行:
在弹出终端窗口中依次输入cmd
、notepad hosts
:
然后就可以任意修改hosts啦
打开终端命令行,输入命令:sudo gedit /etc/hosts
,即可打开并编辑hosts文件。
在打开的hosts
文件中添加下面这段“github520代码”(实现自动更新ip):
# GitHub520 Host Start 140.82.113.26 alive.github.com 140.82.113.26 live.github.com 185.199.108.154 github.githubassets.com 140.82.113.21 central.github.com 185.199.108.133 desktop.githubusercontent.com 185.199.108.153 assets-cdn.github.com 185.199.108.133 camo.githubusercontent.com 185.199.108.133 github.map.fastly.net 199.232.69.194 github.global.ssl.fastly.net 140.82.114.3 gist.github.com 185.199.108.153 github.io 140.82.112.4 github.com 192.0.66.2 github.blog 140.82.112.5 api.github.com 185.199.108.133 raw.githubusercontent.com 185.199.108.133 user-images.githubusercontent.com 185.199.108.133 favicons.githubusercontent.com 185.199.108.133 avatars5.githubusercontent.com 185.199.108.133 avatars4.githubusercontent.com 185.199.108.133 avatars3.githubusercontent.com 185.199.108.133 avatars2.githubusercontent.com 185.199.108.133 avatars1.githubusercontent.com 185.199.108.133 avatars0.githubusercontent.com 185.199.108.133 avatars.githubusercontent.com 140.82.114.10 codeload.github.com 52.216.143.84 github-cloud.s3.amazonaws.com 54.231.140.153 github-com.s3.amazonaws.com 52.217.64.52 github-production-release-asset-2e65be.s3.amazonaws.com 52.217.163.105 github-production-user-asset-6210df.s3.amazonaws.com 52.216.176.139 github-production-repository-file-5c1aeb.s3.amazonaws.com 185.199.108.153 githubstatus.com 64.71.144.202 github.community 23.100.27.125 github.dev 140.82.112.22 collector.github.com 13.107.42.16 pipelines.actions.githubusercontent.com 185.199.108.133 media.githubusercontent.com 185.199.108.133 cloud.githubusercontent.com 185.199.108.133 objects.githubusercontent.com
Windows每天使用前都要刷新一下DNS,否则依旧会很慢
(Ubuntu暂时还不清楚)
Windows+X 打开系统命令行(管理员身份)
或powershell
,
运行ipconfig /flushdns
手动刷新系统DNS缓存。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。