github无法访问解决办法

最近,github.com,又打不开了,或是打开很慢,排除中国白天(米国夜晚)的下载高峰的原因。应该是IP解析的问题。

域名解析有问题,可以用IP直接访问,或是hosts重定向。

首先打开cmd.exe,ping github.com,看看是完全无法访问还是很慢。

1.打开以下网址找到github.com的真实IP

https://github.com.ipaddress.com/

可能这个IP会经常变,(正常是固定的。。。),非常时期就难说了

打开:C:\Windows\System32\drivers\etc\hosts

后面加一条:

140.82.113.3 github.com

再次ping github.com,如果能ping通,说明可以连接github.com了。
————————————————

2.刷新系统DNS缓存

ipconfig /flushdns

你自己试试效果就晓得了。

3.其他方法

chrome浏览器装github加速扩展,火狐浏览器装加速脚本.

4.hosts文件(20210408更新)

# GitHub520 Host Start
185.199.108.154               github.githubassets.com
140.82.112.22                 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.112.3                  gist.github.com
185.199.108.153               github.io
140.82.113.4                  github.com
140.82.113.6                  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.9                  codeload.github.com
52.217.92.172                 github-cloud.s3.amazonaws.com
52.217.105.116                github-com.s3.amazonaws.com
52.216.146.243                github-production-release-asset-2e65be.s3.amazonaws.com
52.216.146.131                github-production-user-asset-6210df.s3.amazonaws.com
52.217.38.28                  github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.108.153               githubstatus.com
64.71.168.201                 github.community
185.199.108.133               media.githubusercontent.com


# Update time: 2021-04-08T10:26:41+08:00
# Star me GitHub url: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End
 

您可能还喜欢...