1.操作方法:
打开hosts文件,可能需要管理员权限。
win10 hosts位置:C:\Windows\System32\drivers\etc
在末尾新建一行,添加如下内容:
2.1方法一 Host文件追加
140.82.112.26 alive.github.com
140.82.114.25 live.github.com
185.199.108.154 github.githubassets.com
140.82.113.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.4 gist.github.com
185.199.108.153 github.io
140.82.112.3 github.com
140.82.112.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.113.10 codeload.github.com
52.217.129.177 github-cloud.s3.amazonaws.com
52.216.178.147 github-com.s3.amazonaws.com
52.216.140.12 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.196.241 github-production-user-asset-6210df.s3.amazonaws.com
52.217.128.49 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
2.2方法二
访问 http://tool.chinaz.com/dns/ ,在输入框中填写 github.com,然后点击检测按钮,会列出响应ip,如图:
选最小TTL值的IP
在hosts文件结尾输入:
20.205.243.166 github.com
3.打开cmd窗口
执行 ipconfig /flushdns
刷新DNS缓存
完成,再访问github.com就很快了。
4.domain security policies(域名策略)的删除与添加
如果再不行,尝试删下代理
以谷歌浏览器为例:打开谷歌浏览器,输入
chrome://net-internals/#hsts
,打开如图所示页面,具体操作步骤如图所示:
当你完成以上四个步骤之后,基本上无论你在哪里,应该都可以进入GitHub官网了。