{"id":13608575,"url":"https://github.com/ineo6/hosts","last_synced_at":"2025-05-13T19:13:11.951Z","repository":{"id":37369467,"uuid":"352276219","full_name":"ineo6/hosts","owner":"ineo6","description":"GitHub最新hosts。解决GitHub图片无法显示，加速GitHub网页浏览。","archived":false,"fork":false,"pushed_at":"2025-04-27T04:19:01.000Z","size":8853,"stargazers_count":5119,"open_issues_count":13,"forks_count":440,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-04-27T05:44:35.954Z","etag":null,"topics":["github","hosts","hosts-file"],"latest_commit_sha":null,"homepage":"https://ineo6.github.io/hosts/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ineo6.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-28T08:19:26.000Z","updated_at":"2025-04-27T04:19:05.000Z","dependencies_parsed_at":"2023-12-18T23:15:24.416Z","dependency_job_id":"6802d8fe-57dc-44b7-bde0-31c27c98918b","html_url":"https://github.com/ineo6/hosts","commit_stats":{"total_commits":15846,"total_committers":7,"mean_commits":2263.714285714286,"dds":0.003218477849299517,"last_synced_commit":"400af0ae4ba05869150bd7f0dc73d4aad568bb98"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineo6%2Fhosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineo6%2Fhosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineo6%2Fhosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ineo6%2Fhosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ineo6","download_url":"https://codeload.github.com/ineo6/hosts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251094600,"owners_count":21535325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","hosts","hosts-file"],"created_at":"2024-08-01T19:01:28.393Z","updated_at":"2025-04-27T05:44:39.857Z","avatar_url":"https://github.com/ineo6.png","language":"TypeScript","readme":"# GitHub Hosts\n\n这个有什么用？最直观的效果是`GitHub`图片可以正常加载，网页也稳定了。\n\n`GitHub Hosts`主要是通过修改`host`的方式加速`GitHub`访问，解决图片无法加载以及访问速度慢的问题。\n\n- 主站: https://github.com/ineo6/hosts\n- 镜像: https://gitlab.com/ineo6/hosts\n- Github Pages: https://ineo6.github.io/hosts/\n\n全新的`GitHub`访问加速工具，等待试用和反馈中，点击 [FastDev](https://github.com/ineo6/fast-dev) 直达。\n\n特点就是稳定！\n\n\u003e `hosts`地址可能会调整，所以请务必关注GitHub、Gitlab主页，保证不迷路，也可以关注公众号：湖中剑。\n\n## 使用方式\n\n### 1. 远程hosts\n\n现在新增了`DNS`获取方案，欢迎使用并反馈。\n\n请查看 [next hosts](https://gitlab.com/ineo6/hosts/-/raw/master/next-hosts)\n\n内容定时更新，最近更新时间：2023-03-08 20:22:25。\n\n```bash\n# New！欢迎使用基于DNS的新方案\n# https://gitlab.com/ineo6/hosts/-/raw/master/next-hosts\n# 地址可能会变动，请务必关注GitHub、Gitlab获取最新消息\n# 也可以关注公众号：湖中剑，保证不迷路\n# GitHub Host Start\n\n# Please Star : https://github.com/ineo6/hosts\n# Mirror Repo : https://gitlab.com/ineo6/hosts\n\n# Update at: 2023-03-08 20:22:25\n\n# GitHub Host End\n```\n\n### 2. 本地 hosts 服务\n\n本地 `hosts` 服务获取到的`ip`是经过本地测试，所以成功率较高。\n\n而且会定时获取最新的`ip`，尽可能保证访问。\n\n注意，该方案需要结合`SwitchHosts`一起使用，或者你也可以直接访问地址，手动复制。\n\n#### macOS (Intel)\n\n执行下面命令, 服务会运行在： http://localhost:8888\n\n```bash\ncurl -L https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-mac-x64.tar.gz | tar xzvf -\nxattr -d com.apple.quarantine ./hosts-server-pkg-mac-x64/hosts-server\n./hosts-server-pkg-mac-x64/hosts-server --port=8888\n```\n\n#### macOS (Apple Silicon)\n\n执行下面命令, 服务会运行在： http://localhost:8888\n\n```bash\ncurl -L https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-mac-arm64.tar.gz | tar xzvf -\n./hosts-server-pkg-mac-arm64/hosts-server --port=8888\n```\n\n#### Linux (x64, amd64)\n\n执行下面命令, 服务会运行在： http://localhost:8888\n\n```bash\ncurl -L https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-linuxstatic-x64.tar.gz | tar xzvf -\n./hosts-server-pkg-linuxstatic-x64/hosts-server --port=8888\n```\n\n#### Linux (ARM64)\n\n执行下面命令, 服务会运行在： http://localhost:8888\n\n```bash\ncurl -L https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-linuxstatic-arm64.tar.gz | tar xzvf -\n./hosts-server-pkg-linuxstatic-arm64/hosts-server --port=8888\n```\n\n#### Run on Linux (ARMv7 32bit)\n\n执行下面命令, 服务会运行在： http://localhost:8888\n\n```bash\ncurl -L https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-linuxstatic-armv7.tar.gz | tar xzvf -\n./hosts-server-pkg-linuxstatic-armv7/hosts-server --port=8888\n```\n\n### Windows\n\n下载 https://github.com/ineo6/hosts/releases/download/v1.0.1/hosts-server-pkg-win-x64.zip ，解压后执行下面命令，服务会运行在： http://localhost:8888\n\n```bash\n.\\hosts-server.exe --port=8888\n```\n\n## 配置hosts教程\n\n### 通过 SwitchHosts 自动更新\n\n这里推荐使用 `SwitchHosts` 配置`hosts`，操作很简单，支持跨平台。\n\n\u003e 注意：首次使用先备份下本地hosts。\n\n详细介绍可以阅读 [SwitchHosts! 还能这样管理hosts，后悔没早点用](https://mp.weixin.qq.com/s/A37XnD3HdcGSWUflj6JujQ) 。\n\n#### 操作步骤\n\n添加一条规则：\n\n- 方案名：GitHub（可以自行命名）\n- 类型：远程\n- URL 地址：https://gitlab.com/ineo6/hosts/-/raw/master/hosts\n- 自动更新：1个小时（时间可自行调整）\n\n这样就可以和最新的`hosts`保持同步。\n\n![switchhost-github.png](https://i.loli.net/2021/03/28/XnHW5xCEzel36fA.png)\n\n### 手动配置\n\n#### macOS\n\n`hosts`文件位置：`/etc/hosts`。\n\n`macOS`系统下修改需要按照如下方式：\n\n##### 1：首先，打开（访达）Finder。\n\n##### 2：使用组合键`Shift+Command+G`打开\"前往文件夹\"，输入框中输入`/etc/hosts`。\n\n##### 3：然后就会跳转到`hosts`文件位置。\n\n\u003e 注意：如果你使用`VS Code`，可以直接用`VS Code`修改和保存，不需要复制文件。\n\n复制`hosts`文件到桌面上，鼠标右键右击它，选择「打开方式」—「文本编辑」，打开这个`hosts`文件，把前面的`hosts`内容复制进来。\n\n然后把你修改好的`hosts`文件替换掉：`/etc/hosts` 文件。\n\n注意：如果弹出密码输入框，你需要输入你当前登录账号对应的密码。\n\n最后刷新缓存：\n\n```shell\nsudo killall -HUP mDNSResponder\n```\n\n#### Windows\n\n`hosts`文件位置：`C:/windows/system32/drivers/etc/hosts`。\n\n将前文`hosts`内容追加到`hosts`文件，然后刷新`DNS`缓存：\n\n```shell\nipconfig /flushdns\n```\n\n## 我的作品\n\n- [GitMaster](https://github.com/ineo6/git-master)：开发者助手，代码仓库结构浏览器扩展\n- [homebrew-install](https://github.com/ineo6/homebrew-install)：Homebrew快速安装教程和脚本\n- [GitHub Hosts](https://github.com/ineo6/hosts)：GitHub最新hosts，定时更新\n- [Awesome Mirror](https://github.com/ineo6/awesome-mirror)：镜像收集，旨在帮助你快速安装开发工具\n- [mp-ci](https://github.com/ineo6/mp-ci)：微信小程序、小游戏发布助手（CI）\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fineo6%2Fhosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fineo6%2Fhosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fineo6%2Fhosts/lists"}