通过修改Hosts解决国内Github经常抽风访问不到
#Github Hosts Start
#Update Time: 2023-06-24
#Project Address: https://github.com/maxiaof/github-hosts
#Update URL: https://raw.githubusercontent.com/maxiaof/github-hosts/master/hosts
#Github Hosts End
最后更新时间:2023-06-24
hosts 文件在不同系统位置不一,详情如下:
- Windows 系统:
C:\Windows\System32\drivers\etc\hosts。 - Mac(苹果电脑)系统:
/etc/hosts。 - Linux 系统:
/etc/hosts。
修改方法,把2.1的内容复制到文本末尾:
- Windows 使用记事本。
- Linux、Mac 使用 Root 权限:
sudo vi /etc/hosts。
大部分情况下是直接生效,如未生效可尝试下面的办法,刷新 DNS:
- Windows:在 CMD 窗口输入:
ipconfig /flushdns - Mac 命令:
sudo killall -HUP mDNSResponder - Linux 命令:
sudo nscd restart
Tips: 如以上刷新不好使,请重启尝试