国内服务器Gay站访问下载解决思路

10次阅读

共计 3017 个字符,预计需要花费 8 分钟才能阅读完成。

有时候在安装许多国外的软件 / 操作面板之类的东西时,遇到 GitHub 的,国内服务器得重试不知道多少次,特别是最近 Gay 站是真的无语

思路分为两步,简单,适合我这种小白

获取国内服务器访问 Gay 站的最佳 IP

修改服务器 hosts

1. 获取 GitHub 高速下载 / 访问 IP

我们平常访问 / 下载 GitHub 的资料时,一般用到域名为:github.com、raw.githubusercontent.com。因此我们需要找到国内访问这两个域名效果较好的 ip,此处分享两个小工具查询

https://sites.ipaddress.com/github.com/

https://ping.chinaz.com/github.com

以站长工具为例,进入后输入对应的网址,我们选择响应时间短的这几个 ip 就行,超时的就不要了

20.205.243.166、20.205.243.166

1.1 快速获取

开源地址:https://github.com/521xueweihan/GitHub520

下面的地址无需访问 GitHub 即可获取到最新的 hosts 内容:

    文件:https://raw.hellogithub.com/hosts
    JSON:https://raw.hellogithub.com/hosts.json

1.2 最新 ip 列表

# GitHub520 Host Start
140.82.114.25                 alive.github.com
140.82.112.5                  api.github.com
185.199.110.153               assets-cdn.github.com
185.199.109.133               avatars.githubusercontent.com
185.199.109.133               avatars0.githubusercontent.com
185.199.109.133               avatars1.githubusercontent.com
185.199.109.133               avatars2.githubusercontent.com
185.199.109.133               avatars3.githubusercontent.com
185.199.109.133               avatars4.githubusercontent.com
185.199.109.133               avatars5.githubusercontent.com
185.199.109.133               camo.githubusercontent.com
140.82.114.21                 central.github.com
185.199.109.133               cloud.githubusercontent.com
140.82.114.10                 codeload.github.com
140.82.112.22                 collector.github.com
185.199.109.133               desktop.githubusercontent.com
185.199.109.133               favicons.githubusercontent.com
140.82.112.4                  gist.github.com
54.231.131.57                 github-cloud.s3.amazonaws.com
52.217.233.129                github-com.s3.amazonaws.com
54.231.232.41                 github-production-release-asset-2e65be.s3.amazonaws.com
52.217.46.60                  github-production-repository-file-5c1aeb.s3.amazonaws.com
52.217.202.169                github-production-user-asset-6210df.s3.amazonaws.com
192.0.66.2                    github.blog
140.82.113.4                  github.com
140.82.112.17                 github.community
185.199.110.154               github.githubassets.com
151.101.1.194                 github.global.ssl.fastly.net
185.199.110.153               github.io
185.199.109.133               github.map.fastly.net
185.199.110.153               githubstatus.com
140.82.112.25                 live.github.com
185.199.109.133               media.githubusercontent.com
185.199.109.133               objects.githubusercontent.com
13.107.42.16                  pipelines.actions.githubusercontent.com
185.199.109.133               raw.githubusercontent.com
185.199.109.133               user-images.githubusercontent.com
13.107.246.40                 vscode.dev
140.82.114.22                 education.github.com

# Update time: 2024-01-25T08:20:07+08:00
# Update url: https://raw.hellogithub.com/hosts
# Star me: https://github.com/521xueweihan/GitHub520
# GitHub520 Host End

2. 服务器 hosts 修改方法
针对 Linux
修改:vim /etc/hosts
可以直接打开对应的文件路径,用文本编辑器,把上面那串复制到底部

按 i 切换至编辑模式。

将上面查询到的合适 ip 加到 hosts 文件即可

20.205.243.166 github.com
185.199.111.133 raw.githubusercontent.com
185.199.111.133 raw.githubusercontent.com

输入完成后,按 Esc,输入 :wq,保存文件并返回。

关于 WordPress 优化:https://hostloc.com/thread-1258702-1-1.html

关于 WordPress 个人主题推荐:https://www.xcbtmw.com/29244.html

正文完
 0