GithubHelp home page GithubHelp logo

google-hosts's Introduction

google-hosts

授人以渔 | 授人以鱼 | 必读技巧

为什么有这个项目

因为我每天都要访问Google, 以及我的朋友们也会访问Google.
然而朋友们对其他更复杂的代理未做深入研究, 最简单方法便是帮他们修改 hosts.
于人于己方便, 便弄了这个项目. 包含了大部分Google服务, G+, Drive, Gmail, Hangouts, Calendar等
域名参考了smarthosts, ipv6-hosts.

IP不总是可用的, 因素可能是GFW封锁或Google IP变动.
同一个IP, A省能连上, B省就可能连不上(网络封锁). 上一个小时能连上, 这一个小时连不上(间歇性阻断)
另外Google的好多服务都已经不挂在北京的IP上了

如何自己用程序找IP

find.sh查询某段IP详细信息,可接受一个或多个参数(这个可检测IP是否被封锁, 443端口是否被封锁)

$ cd google-hosts/scripts

# 查询 192.168.1.x
$ ./find.sh 192.168.1

# 查询 192.168.x.x
$ ./find.sh 192.168

# 查询 192.168.x.x, 192.169.x.x, 192.170.1.x
$ ./find.sh 192.168 192.169 192.170.1

filter.sh从output目录(由find.sh生成)过滤域名

$ cd google-hosts/scripts

# 过滤可用于*.google.com的域名
$ ./filter.sh *.google.com

# 过滤可用于mail.google.com的域名
$ ./filter.sh mail.google.com

use.sh使用过滤出的某个IP并更新hosts.all文件

$ cd google-hosts/scripts

# 使用可用于*.google.com 的IP 192.168.1.1
$ ./use.sh *.google.com 192.168.1.1

# 使用可用于mail.google.com 的IP 192.168.1.1
$ ./use.sh mail.google.com 192.168.1.1

select.sh结合了filter.sh, use.sh,自动选择最佳IP写入hosts.all文件, 并做了些特殊域名处理

$ cd google-hosts/scripts
$ ./select.sh

apply.sh使用hosts.all文件更新../hosts文件

$ cd google-hosts/scripts
$ ./apply.sh

auto.sh结合了find.sh, select.sh, apply.sh自动查询后选择最佳IP写入../hosts文件

$ cd google-hosts/scripts

# 查询192.168.x.x,192.169.1.x, 并在查询完后自动选择最佳IP更新../hosts文件
$ ./auto.sh 192.168 192.169.1

输出的四个字段含义

IP LOSS TIME SSL
此IP 丢包率 PING值 可用ssl域名

获取Google IP段可供参考

$ nslookup -q=TXT _netblocks.google.com 8.8.4.4

使用当前的hosts

如果此hosts文件内的IP失效, 就需要你自己用上面提到的脚本查询了
下面的程序不会覆盖你原有的hosts

Windows 用户

  1. 请先退出所有杀毒软件
  2. Windows XP 以上请使用管理员身份运行或赋予hosts文件可写权限
  3. 使用及更新: fuckGFW-64.exe(64位) / fuckGFW-32.exe(32位)双击运行

*nix/OSX 用户

  1. 使用及更新: 打开终端运行$ curl http://tx.txthinking.com/fuckGFW.py | sudo python

必读技巧

  • 请使用国际版google. 防止google本地化重定向: 访问一下https://www.google.com/ncr
  • 请使用https替代http访问.

Contributing

  • vim:ts=4:sw=4:expandtab:ff=unix:encoding=utf8
  • Please create your pull request on develop branch

License

Licensed under The MIT License

google-hosts's People

Contributors

txthinking avatar ledu avatar walkthetalk avatar lyy avatar myisjon avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.