diff --git a/index-template.php b/index-template.php index 54878e5..48f39b2 100644 --- a/index-template.php +++ b/index-template.php @@ -9,10 +9,7 @@
fetch-github-hosts
是主要为解决研究及学习人员访问Github
过慢或其他问题而提供的免费的Github hosts
同步服务。
本项目部分参考于 Github520 ,
- 但与之不同的是前者是通过ipaddress.com
获取github.com
的hosts
,
- 而此项目是通过部署本身的服务器来获取github.com
的hosts
,所以在IP节点上会存在一定的差异。
fetch-github-hosts
是主要为解决研究及学习人员访问 Github
过慢或其他问题而提供的免费的 Github Hosts
同步服务。
最近获取时间: @@ -21,50 +18,52 @@ [hosts.txt] [hosts.json]
-此项目是通过部署此项目本身的服务器来获取 github.com
的 hosts
,而不是通过第三方ip地址接口来进行获取,例如 ipaddress.com
等
访问 https://hosts.gitcdn.top/hosts.txt , - 将其全部内容粘贴到你的hosts文件中,即可。
+ 将其全部内容粘贴到你的hosts文件中,即可。Linux / MacOS
hosts路径:/etc/hosts
Windows
hosts路径:C:\Windows\System32\drivers\etc\hosts
Linux / MacOS
hosts路径:/etc/hosts
Windows
hosts路径:C:\Windows\System32\drivers\etc\hosts
Linux
: /etc/init.d/network restart
Windows
: ipconfig /flushdns
Macos
: sudo killall -HUP mDNSResponder
Linux
: /etc/init.d/network restart
Windows
: ipconfig /flushdns
Macos
: sudo killall -HUP mDNSResponder
sed -i "/# fetch-github-hosts begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts
-
+
-提示:可以设置crontab定时任务定时获取更新即可,解放双手!
+提示:可以设置crontab定时任务定时获取更新即可,解放双手!
使用 FasterHosts 插件,若访问速度过慢可以直接使用 - 点击此处 来进行下载。
+使用 FasterHosts 插件,若访问速度过慢可以直接使用 + 点击此处 来进行下载。
下载完成之后解压压缩包,Chrome地址栏输入chrome://extensions/
回车进入,勾选开发者模式
,选择加载已解压的扩展程序
,
- 选择刚才的解压目录即可。
使用 SwitchHosts 桌面端应用,安装添加新规则:
+使用 SwitchHosts 桌面端应用,安装添加新规则:
Title
: 任意Type
: Remote
Url
: https://hosts.gitcdn.top/hosts.txt
Auto refresh
: 1 hour
Title
: 任意Type
: Remote
Url
: https://hosts.gitcdn.top/hosts.txt
Auto refresh
: 1 hour
下载本仓库的代码:fetch-github-hosts.zip , - 部署到任意一个含有PHP环境的服务器即可,部署完成之后可以计划任务脚本定时更新hosts:
+ 部署到任意一个含有PHP环境的服务器即可,部署完成之后可以计划任务脚本定时更新hosts:cd /wwwroot/fetch-github-hosts #此处更换为你部署的项目路径
-php fetch_hosts.php
-
+ php fetch_hosts.php
+
--注意:必须部署到非大陆的服务器节点!
+注意:必须部署到非大陆的服务器节点!