修改host
1.打开host文件
sudo vim /etc/hosts
2.查找github.com和github.global.ssl.fastly.net的ip
GitHub.com - GitHub: Let's build from here · GitHub (ipaddress.com)
Fastly.net - Powering the best of the internet | Fastly (ipaddress.com)
往下翻
3.写入hosts文件
i ,进入编辑模式,写完后, :wq! 保存退出。
# github
140.82.114.4 github.com
151.101.1.6 github.global.ssl.fastly.net
151.101.65.6 github.global.ssl.fastly.net
151.101.129.6 github.global.ssl.fastly.net
151.101.193.6 github.global.ssl.fastly.net
4.关闭文件重启服务
/etc/init.d/networking restart
即可访问github
备注:
若是ip地址改变,重新执行一遍操作。