Skip to content

vvshyer/hosts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

更多内容请访问hosts wiki

Windows

用文本编辑器(如Notepad++|记事本)打开C:\Windows\System32\drivers\etc中的hosts文件,
把 -> hosts <- 全部内容复制到hosts文件中,保存后通过 开始 -> 运行 -> 输入cmd -> 在CMD窗口输入ipconfig /flushdns使其生效。
注意:如果遇到无法保存,请右键hosts->属性->安全,然后选择你登陆的用户名,最后点击编辑,勾选"写入"即可。

Linux

开启终端(快捷键为"Ctrl + Alt + T")输入bash -c 'wget https://raw.githubusercontent.com/racaljk/hosts/master/hosts -qO /tmp/hosts && sudo mv /tmp/hosts /etc/hosts'
最后在终端输入sudo systemctl restart NetworkManager
注意 : 非systemd发行版,终端输入sudo rcnscd restart,如果不清楚请两个都试一次,或者参考#100

Mac OS

请在/private/etc/目录下新建或修改hosts,然后终端输入sudo killall -HUP mDNSResponder使其生效。

Android

请在/system/etc目录下新建或修改hosts,然后通过开启飞行模式 -> 关闭飞行模式 的方式使其生效。

iOS

请在/etc目录下新建或修改hosts使其生效。

Annoucement

  • Linux、Mac、Android用户请用Notepad++ 转换文本编码和换行符格式,否则hosts可能会无法正常工作。对此你可以参考这个解决方案
  • Android和iOS需要root权限和越狱后才能访问hosts文件。
  • 由于部分App不支持SNI,故不推荐在移动设备上使用
  • 转载和使用过程中请保留hosts文件注释以及任何能体现版权的信息。
  • 衷心感谢每位参与开源hosts的用户Contributors

License

  • Code of this project is licensed under the MIT License
  • Content of this project (including hosts , wiki and Readme) is licensed under CC BY-NC-SA 4.0 img-source-from-https://github.com/docker/dockercraft

About

🗽最新可用的google hosts文件

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 59.8%
  • C++ 32.3%
  • Batchfile 3.6%
  • Shell 2.2%
  • QMake 2.1%