GitHub-Hosts
一、简介
通过修改Hosts文件解决中国大陆地区访问GitHub经常不稳定的问题
二、使用方法
2.1 复制以下内容
#Github Hosts 开始
#更新时间:2024-08-23
#项目地址:https://github.com/maxiaof/github-hosts
#更新链接:https://raw.githubusercontent.com/maxiaof/github-hosts/master/hosts
140.82.112.25 alive.github.com
140.82.113.26 live.github.com
185.199.110.154 github.githubassets.com
140.82.114.22 central.github.com
185.199.108.133 desktop.githubusercontent.com
185.199.108.153 assets-cdn.github.com
185.199.110.133 camo.githubusercontent.com
185.199.108.133 github.map.fastly.net
146.75.121.194 github.global.ssl.fastly.net
140.82.121.4 gist.github.com
185.199.109.153 github.io
140.82.121.3 github.com
192.0.66.2 github.blog
140.82.121.5 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.109.133 avatars5.githubusercontent.com
185.199.109.133 avatars4.githubusercontent.com
185.199.111.133 avatars3.githubusercontent.com
185.199.110.133 avatars2.githubusercontent.com
185.199.109.133 avatars1.githubusercontent.com
185.199.109.133 avatars0.githubusercontent.com
185.199.108.133 avatars.githubusercontent.com
140.82.121.10 codeload.github.com
16.182.97.25 github-cloud.s3.amazonaws.com
52.216.57.105 github-com.s3.amazonaws.com
3.5.29.37 github-production-release-asset-2e65be.s3.amazonaws.com
16.182.99.177 github-production-user-asset-6210df.s3.amazonaws.com
3.5.25.196 github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.110.153 githubstatus.com
140.82.114.17 github.community
51.137.3.17 github.dev
140.82.114.22 collector.github.com
13.107.42.16 pipelines.actions.githubusercontent.com
185.199.111.133 media.githubusercontent.com
185.199.109.133 cloud.githubusercontent.com
185.199.111.133 objects.githubusercontent.com
#Github Hosts 结束
最后更新时间:2024-08-23
2.2 修改 hosts 文件
hosts 文件在不同系统中的位置如下:
- Windows 系统:
C:\Windows\System32\drivers\etc\hosts
- Mac(苹果电脑)系统:
/etc/hosts
- Linux 系统:
/etc/hosts
修改方法,将2.1的内容复制到文件末尾:
- Windows 使用记事本。
- Linux、Mac 使用 Root 权限:
sudo vi /etc/hosts
2.3 使修改生效
大多数情况下修改会立即生效,如未生效可尝试以下方法刷新 DNS:
- Windows:在 CMD 窗口输入:
ipconfig /flushdns
- Mac 命令:
sudo killall -HUP mDNSResponder
- Linux 命令:
sudo nscd restart
提示: 如果上述刷新方法无效,请尝试重启系统