2022-06-15 16:53

Github无法访问或者访问慢的终极解决方法(亲测可用)

少尉

其它

(588)

(0)

收藏

blog

GitHub是世界上最大的代码托管平台,超5千万开发者正在使用。

做为一个程序员,访问不了Github怎么行呢?所以我们下面来看下Github无法访问或者访问很慢如何解决。

国内的一个开发者 @521xueweihan 在 GitHub 上创建了一个项目「GitHub520」,提供了一份优化 GitHub 访问体验的 hosts 列表。

本方法无需查询,直接使用就可以了,而且会定期更新,更新文件网址:https://raw.hellogithub.com/hosts

为了方便大家使用,我把hosts列表直接复制到了下面:

一、复制下面的内容

# GitHub520 Host Start

140.82.112.26                 alive.github.com

140.82.113.25                 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

146.75.77.194                 github.global.ssl.fastly.net

140.82.113.3                  gist.github.com

185.199.108.153               github.io

140.82.114.4                  github.com

192.0.66.2                    github.blog

140.82.114.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.112.10                 codeload.github.com

54.231.202.49                 github-cloud.s3.amazonaws.com

54.231.228.105                github-com.s3.amazonaws.com

52.217.197.65                 github-production-release-asset-2e65be.s3.amazonaws.com

54.231.137.105                github-production-user-asset-6210df.s3.amazonaws.com

52.217.160.97                 github-production-repository-file-5c1aeb.s3.amazonaws.com

185.199.108.153               githubstatus.com

64.71.144.211                 github.community

23.100.27.125                 github.dev

140.82.112.21                 collector.github.com

13.107.43.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

# Update time: 2022-06-15T14:06:04+08:00

# Update url: https://raw.hellogithub.com/hosts

# Star me: https://github.com/521xueweihan/GitHub520

# GitHub520 Host End

上面内容会自动定时更新,保证最新有效。数据更新时间:2022-06-15T14:06:04+08:00(内容无变动不会更新)

文件:https://raw.hellogithub.com/hosts

JSON:https://raw.hellogithub.com/hosts.json

二、修改hosts文件

这里我们以windows系统为例,其他系统请自行搜索hosts文件的位置。

windows系统hosts文件的位置是:C:\Windows\System32\drivers\etc\hosts

然后在hosts文件上面右键-打开方式-用记事本打开

打开之后,把上面的内容复制进去。

image.png

三、刷新DNS解析

在开始菜单右键-运行-然后输入cmd,打开cmd命令提示符

image.png

然后在cmd中输入 ipconfig /flushdns 刷新dns缓存

image.png

现在就可以正常访问Github了。

image.png

0条评论

点击登录参与评论