{"id":21270248,"url":"https://github.com/henson/hosts","last_synced_at":"2025-10-10T19:33:17.786Z","repository":{"id":57513959,"uuid":"121867828","full_name":"henson/hosts","owner":"henson","description":"自动生成 Hosts 文件，科学上网","archived":false,"fork":false,"pushed_at":"2018-07-17T05:20:16.000Z","size":87,"stargazers_count":33,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-06T00:11:36.761Z","etag":null,"topics":["flickr","hosts","instagram","medium","pinterest","tumblr"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/henson.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}},"created_at":"2018-02-17T15:46:42.000Z","updated_at":"2024-10-11T03:57:15.000Z","dependencies_parsed_at":"2022-08-30T01:50:27.463Z","dependency_job_id":null,"html_url":"https://github.com/henson/hosts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/henson/hosts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henson%2Fhosts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henson%2Fhosts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henson%2Fhosts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henson%2Fhosts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/henson","download_url":"https://codeload.github.com/henson/hosts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/henson%2Fhosts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263361263,"owners_count":23454903,"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":["flickr","hosts","instagram","medium","pinterest","tumblr"],"created_at":"2024-11-21T08:16:45.210Z","updated_at":"2025-10-10T19:33:12.750Z","avatar_url":"https://github.com/henson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hosts\r\n\r\n自动生成 Hosts 文件，科学上网\r\n\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/henson/hosts)](https://goreportcard.com/report/github.com/henson/hosts)  [![Travis Status for henson/hosts](https://travis-ci.org/henson/hosts.svg?branch=master)](https://travis-ci.org/henson/hosts)  [![GitHub release](https://img.shields.io/github/release/henson/hosts.svg)](https://github.com/henson/hosts/releases/tag/v1.0)\r\n\r\n![《取经》](1947422058.jpg)\r\n\r\n图题《取经》（作者：@青红造了个白 ，侵删！）\r\n\r\n## 特别声明\r\n\r\n本项目仅作技术学习之用，不鼓励、不支持也不赞成任何互联网违法违规行为，任何不当使用的行为概与本项目无关！！！\r\n\r\n### 特点\r\n\r\n- 自动生成 Hosts 文件\r\n- 超快的响应速度\r\n- 支持 Windows 和 Linux 系统\r\n\r\n### 更新日志\r\n\r\n- 2018.02.18\r\n  - 添加配置文件\r\n  - 支持 Windows 和 Linux\r\n- 2018.02.10\r\n  - 提升访问速度\r\n\r\n### 目前可访问网站\r\n\r\n|目标网站|响应时间|\r\n|:------|------:|\r\n|www.instagram.com|25.947 ms|\r\n|www.tumblr.com|30.690 ms|\r\n|www.flickr.com|4.871 ms|\r\n|www.medium.com|5.111 ms|\r\n|www.pinterest.com|28.895 ms|\r\n|www.vimeo.com|4.893 ms|\r\n|~~www.twitter.com~~|ip 被封|\r\n|~~www.youtube.com~~|同上|\r\n|~~www.facebook.com~~|同上|\r\n|~~www.golang.org~~|同上|\r\n\r\n本项目只能解决 DNS 被污染情况，并不能解除 IP 封印，所以并不是对所有网站都适用。欢迎大家提交 issue ，告知其它网站访问情况，以便更新。\r\n\r\n## 使用方法\r\n\r\n### 直接下载可执行文件\r\n\r\n根据平台直接下载各版本运行文件： [releases](https://github.com/henson/hosts/releases)\r\n\r\n### 从源码编译本项目\r\n\r\n```\r\ngo get -u github.com/henson/hosts\r\n```\r\n\r\n### 程序运行\r\n\r\n修改同目录下配置文件 config.yaml，添加相应的目标网站，以“ | ”符号分隔\r\n\r\n```yml\r\n# 目标网站\r\nhosts: \"www.instagram.com|www.tumblr.com|www.flickr.com|www.medium.com|www.pinterest.com\"\r\n```\r\n\r\n使用前，先备份系统中的 hosts 文件\r\n\r\n\u003e Windows 系统下文件路径：\r\n\u003e \r\n\u003e C:\\Windows\\System32\\drivers\\etc\\hosts\r\n\r\n\u003e Linux 系统下文件路径：\r\n\u003e \r\n\u003e /etc/hosts\r\n\r\n\r\n然后运行主程序\r\n\r\n```\r\ngo run hosts.go\r\n```\r\n\r\n或\r\n\r\n```\r\ngo build\r\n\r\n./hosts\r\n```\r\n\r\n### 日常使用\r\n\r\n在浏览器中使用 **Https** 来访问目标网站，为免 IP 修改或 DNS 被污染，建议每个月运行一下程序。**如果本项目能给您工作和学习带来便利，请不吝 Star，谢谢！**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenson%2Fhosts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhenson%2Fhosts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhenson%2Fhosts/lists"}