目录
- github 加载不出来
- 获取GitHub官方CDN地址
- 修改系统Hosts文件
- 刷新缓存
github 加载不出来
获取GitHub官方CDN地址
- https://www.ipaddress.com/打开后如图,右上角搜索查
- 查找这三个DNS链接的解析地址
http://github.com
http://assets-cdn.github.com
http://github.global.ssl.fastly.net
修改系统Hosts文件
hosts 文件在每个系统的位置不一,详情如下:
Windows 系统:C:\Windows\System32\drivers\etc\hosts
Linux 系统:/etc/hosts
Mac(苹果电脑)系统:/etc/hosts
Android(安卓)系统:/system/etc/hosts
iPhone(iOS)系统:/etc/hosts
- 添加如下
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
140.82.113.3 github.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
151.101.1.194 github.global.ssl.fastly.net
151.101.65.194 github.global.ssl.fastly.net
151.101.129.194 github.global.ssl.fastly.net
151.101.193.194 github.global.ssl.fastly.net
在末尾添加三行记录并保存。(需管理员权限,注意IP地址与域名间需留有空格)
其实就是为域名添加 IP 映射。
- 没办法直接管理员权限打开改,就先把文件挪出去改完再挪回来
- 改后再打开github,然后hosts文件末尾自动如下
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
140.82.113.3 github.com
140.82.113.3 gist.github.com
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com
151.101.1.194 github.global.ssl.fastly.net
151.101.65.194 github.global.ssl.fastly.net
151.101.129.194 github.global.ssl.fastly.net
151.101.193.194 github.global.ssl.fastly.net
185.199.108.133 raw.githubusercontent.com
185.199.108.133 gist.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 camo.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars6.githubusercontent.com
185.199.108.133 avatars7.githubusercontent.com
185.199.108.133 avatars8.githubusercontent.com
刷新缓存
- 在电脑搜索框cmd打开命令提示符窗口
- 然后输入
ipconfig /flushdns
刷新缓存再打开github
- 成功打开