只需要修改对应的hosts文件
在hosts文件末尾添加两行
https://github.com 13.229.188.59
https://github.global.ssl.fastly.Net 151.101.229.194
例如:Windows上的hosts文件路径在
C:\Windows\System32\drivers\etc\hosts,记事本打开
同理
Linux的hosts文件路径在/etc/hosts中
sudo vim /etc/hosts
键盘按下i字母,编辑,光标到最后,另起一行,复制粘贴。
Esc键退出编辑,输入:wq退出保存。
Mac的hosts文件路径也在/etc/hosts中
sudo vi /etc/hosts
2、刷新DNS缓存(需要)
Linux:
sudo /etc/init.d/networking restart
Windows:
ipconfig /flushdns
Mac:
sudo killall -HUP mDNSResponder
原文参考:https://blog.csdn.net/xiaolong_4_2/article/details/105389128