后期使用到github下载源码,会发现响应太慢,本篇文章解决你的问题
- 获取域名对应的ip
访问链接:https://raw.hellogithub.com/hosts(ps:这链接定时更新),获取对应的host配置。
如果需要工具自动更新的话,点击链接:https://github.com/oldj/SwitchHosts
特别说明
Github的IP地址是不断变化的,如果发现网站打不开了,可以获取新的IP地址修改hosts里面的内容,方式如下:
在网站https://www.ipaddress.com/ 输入你要解析的域名。例如:github.com的IP获取方式,在输入框输入以下内容:
敲击你最爱的回车键,你会得到:
要的就是红框框里的内容。获取了相关信息后,可以替换hosts里的内容即可。
- 修改hosts文件
140.82.114.25 alive.github.com
140.82.114.6 api.github.com
185.199.109.153 assets-cdn.github.com
185.199.111.133 avatars.githubusercontent.com
185.199.111.133 avatars0.githubusercontent.com
185.199.111.133 avatars1.githubusercontent.com
185.199.111.133 avatars2.githubusercontent.com
185.199.111.133 avatars3.githubusercontent.com
185.199.111.133 avatars4.githubusercontent.com
185.199.111.133 avatars5.githubusercontent.com
185.199.111.133 camo.githubusercontent.com
140.82.113.22 central.github.com
185.199.111.133 cloud.githubusercontent.com
140.82.114.9 codeload.github.com
140.82.114.22 collector.github.com
185.199.111.133 desktop.githubusercontent.com
185.199.111.133 favicons.githubusercontent.com
140.82.112.4 gist.github.com
54.231.233.97 github-cloud.s3.amazonaws.com
16.182.73.65 github-com.s3.amazonaws.com
54.231.160.209 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.33.212 github-production-repository-file-5c1aeb.s3.amazonaws.com
52.216.50.225 github-production-user-asset-6210df.s3.amazonaws.com
192.0.66.2 github.blog
140.82.112.3 github.com
140.82.114.17 github.community
185.199.110.154 github.githubassets.com
151.101.1.194 github.global.ssl.fastly.net
185.199.109.153 github.io
185.199.111.133 github.map.fastly.net
185.199.109.153 githubstatus.com
140.82.113.25 live.github.com
185.199.111.133 media.githubusercontent.com
185.199.111.133 objects.githubusercontent.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.111.133 raw.githubusercontent.com
185.199.111.133 user-images.githubusercontent.com
13.107.253.40 vscode.dev
140.82.113.21 education.github.com