Git Product home page Git Product logo

huhamhire-hosts's Introduction

Hosts Setup Utility

Introduction

Since the governments of some countries are using technical methods blocking internet access to some websites and web service providers which includes some world famous sites like Google, YouTube, twitter, Facebook, and Wikipedia etc., we designed this tiny utility in order to help people getting through the Internet blockade.

Hosts Setup Utility provides basic tools to manage the hosts file on current operating systems. It also provides both support for Graphical Desktop environment with Graphical User Interface (GUI) and CLI environment with Text-based User Interface (TUI).

Users could use these tool to modify the hosts to visit specified websites or services blocked by ISP/government. Functions which help users to backup/restore hosts files are also provided.

Hosts Setup Utility is designed by huhamhire-hosts team. For further information, please visit our website.

Developer Documentation

Developers could find our project documentation by visiting https://hosts.huhamhire.com/document/.

This documentation contains descriptions of modules and functions which are used in the current version of Hosts Setup Utility. These documents also provides some optional methods for developers to help improve this tool.

License

Licensed under the GNU General Public License, version 3. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

System Requirements

Here are the system requirements needed for using Hosts Setup Utility.

Graphical User Interface (GUI)

System requirements to run Hosts Setup Utility on Graphical Desktop are listed here:

  • Microsoft Windows 2000 or newer for Windows users.

  • Mac OS X 10.6 or newer for Macintosh users.

  • Linux/X11 desktop with Python 2 and PyQt4 for Linux/X11 users.

  • Internet access is required for retrieving the latest hosts data file.

    • On some linux distributions, pre-built packages of PyQt4 can be found in software repositories. For example, you can install PyQt4 on a debian distribution simply using:

      apt-get install python-qt4

More requirements are needed for developers:

  • Python 2.6/2.7 with PyQt4 extension for developers.
  • py2exe or py2app would be required while making binary executables for specified platforms.

Text-based User Interface (TUI)

Any devices with Python 2 and Python Standard Library INSTALLED could run Hosts Setup Utility in TUI mode from a 80x24 terminal. In addition to this, TUI mode could also be operated via SSH on remote devices/machines/servers. All you need is a system with Python 2 installed.

Get Started

Since Hosts Setup Utility supports both Graphical Desktop environment with Graphical User Interface (GUI) and CLI/terminal environment with Text-based User Interface (TUI), users could the way they would like to launch this tool.

However, GUI mode is highly recommended because several features like backup/restore hosts file are still not supported in TUI mode currently.

  • If the program is not running with privileges to modify the hosts file, a warning message would be shown and you could only do operations like backup hosts file and update the local data file. Plus, TUI mode could not get started in this condition.

Graphical User Interface (GUI) Mode

  • Windows(x86/x64): Run hoststool.exe from the binary executables package to get started.

    • "Run as Administrator" is needed for operations to change the hosts file on Windows Vista or newer.
  • Mac OS X: Run HostsUtl application from the binary executables package to get started.

    • Because of the locale problem with py2app, the automatic language selection may not work correctly on Mac OS with binary executable files. You can just choose the language on your on choice.
  • Linux/X11(Source code): Run command "python hoststool.py" to get started.

    • All platforms with Python and the PyQt4 could use this method to run with the source code.
    • A desktop environment with PyQt4 and python is needed only for Linux/X11 users to start a GUI Session.

Text-based User Interface (TUI) Mode

  • Windows Executable(x86/x64):

    1. Start a command line(could be cmd or Power Shell).
      • "Run as Administrator" is needed for operations to change the hosts file on Windows Vista or newer.
    2. Change directory to the folder contains binary executable files. of Hosts Setup Utility.
    3. Run hoststool_tui.exe with an argument -t from the directory to get started.
  • Python Source Code:

    Python Source Code is very easy to be started through any terminals on any operating systems.

    1. Change your directory to the source script.
    2. Run python hoststool.py -t in the terminal. Of course, wirte privileges to access the hosts file on current system is required. If not, a warning message box would show up and then terminate current session.

User Customized Hosts

Users are allowed to add customized hosts list as an independent module to make a hosts file. All you need to do is create a simple text file named custom.hosts in the working directory, and put your own hosts entries into this file. Then you would find a Customized Hosts option in the function list.

  • Non-ASCII characters are not recommended to be put into the customized hosts file.

Author/Maintainer

huhamhire mailto:[email protected]

huhamhire-hosts's People

Contributors

aguegu avatar chinamerp avatar dawsbot avatar huhamhire avatar samsong8610 avatar skela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huhamhire-hosts's Issues

如何删除啊。安装后

如何删除。我mac安装后,想删除怎么删除?用的dmg的。。
还有我改本机hosts已经不生效了。。。
为什么只有安装文档,没有卸载呢

host文件问题

我遇到这样的问题:
在eclipse里android SDK manager更新时会出现错误,后来把host文件的相应地方改为

203.208.46.146 dl.google.com
203.208.46.146 dl-ssl.google.com

       得到解决。详细情况见
       http://www.v2ex.com/t/135473#reply11

Twitter

I still can't get access to twitter. Instead, I get a message saying that the server did not respond. I am using Firefox 30.0. Can anyone tell me why this is going on?

IOS下,hosts大多时候无法访问google,app也是,但是facebook的app却可以访问

您遇到的问题:
1.把hosts文件放在IOS里之后,google大多时候都无法访问或者访问极其慢,不像电脑上访问那么快

您使用的hosts文件版本:1.4.9
您使用的操作系统:IOS 7.1.2(文件路径etc/hosts)
您所在的区域(省/市):武汉市
您使用的ISP(网络运营商):WIFI(电信10MB家庭ADSL看待) 3G(联通)
网络环境(IPv4/IPv6):IPv4

有关问题的其他描述:

Don't disable buttons after applying hosts

This is a feature request.
After applying hosts, the "apply hosts" button and "save with ..." buttons would be disabled. This is a bit annoying. When testing the hosts file, e.g. manually renamed or cut it away, or if I want to save file elsewhere after applying, I have to click "download data file" to enable these buttons again.

Google is not available

Hi, Huhamhire team. The Google host is not available, could you make a tiny update? It will very grateful.

Poisoned ip addresses

37.61.54.158
46.82.174.68
59.24.3.173
These three(maybe more) ip addresses are fake, coming from GFW.
Some items of the hosts downloaded contain them.

Error as described.

richard@gentoo ~/Downloads/kk/HostsTool-x11-gpl-1.9.8-SE $ sudo python2 hoststool.py
Fontconfig warning: "/etc/fonts/conf.d/44-wqy-zenhei.conf", line 11: Having multiple values in isn't supported and may not work as expected
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Traceback (most recent call last):
File "/home/richard/Downloads/kk/HostsTool-x11-gpl-1.9.8-SE/gui/_make.py", line 103, in run
self.make()
File "/home/richard/Downloads/kk/HostsTool-x11-gpl-1.9.8-SE/util/makehosts.py", line 93, in make
self.get_hosts(self.make_cfg)
File "/home/richard/Downloads/kk/HostsTool-x11-gpl-1.9.8-SE/gui/_make.py", line 123, in get_hosts
if not RetrieveData.chk_mutex(part_id, mod_cfg):
File "/home/richard/Downloads/kk/HostsTool-x11-gpl-1.9.8-SE/util/retrievedata.py", line 283, in chk_mutex
mutex_info.extend(cls.get_ids(mutex_tuple[mod_id]))
KeyError: 1

Please ignore font issue and libpng warning, Just see traceback. At this time, Hosts Setup Utility hangs on. see attachment.
2014-06-14-110615_1366x768_scrot

TypeError: coercing to Unicode: need string or buffer, NoneType found

额,下载下来第一次可以正常打开,也能成功连接到服务器,当我点击下载host的时候,发现程序报错了(报错信息显示在终端里),就是和标题差不多的报错信息,然后我打开hosts,却发现里面是空的。
当我关闭软件再次打开的时候,直接失败了,错误信息看下图

screenshot from 2014-06-02 00 21 19

建议增加 Apple iCloud 的hosts

icloud.com
setup.icloud.com
webcourier.push.apple.com

p17-bookmarks.icloud.com
p17-bookmarks.icloud.com
p17-calendarws.icloud.com
p17-contactsws.icloud.com
17-courier.push.apple.com
p17-keyvalueservice.icloud.com
p17-pushws.icloud.com
p17-remindersws.icloud.com

以上域名数字部分仅仅是序列中的一个

个人的iCloud在没有增加hosts的状况下会遭遇错误无法同步
不知其他用户是否有相同的情况

测试结果

我在北京通州,我的测试结果:1.如果谷歌web服务和应用程序服务都选择美国服务器,google+能正常打开,但是,不能打开google搜索后的网页,比如,我在谷歌搜索“goagent”,ok,能打开,但是,进而点击goagent的相关网址,无法加载;2.为了能够正常使用google搜素功能,我只能用北京的谷歌web服务,但是,无论google应用程序选择北京服务器还是美国服务器,google+打不开。看来,google和google+不能兼得.

1.5.1 more issues report

  1. google ips seem no longer usable since the day before yesterday afaik.
  2. Hosts in android still have issues, for instance, connecting to google server. Btw, loading a webpage is so slow.
  3. Firefox add-ons still cannot open. If needed, I can provide a screenshot.
  4. With your hosts, I cannot open Deviantart. Unless I delete your hosts. This is really odd..

Please fix. ;-)

连接被重置

我查了一下/etc/hosts文件,里面google的ip 173.x.x.x是google-us那部分的吧?在我这边,第一次能够打开google的网页,可是,进一步加载谷歌搜索后的网页,却是不行: 连接被重置. 我希望还是能够在hosts文件中,区分google-cn和google-us ;-)

可以生成dnsmaq的配置文件格式么

就是类似
address=/ggpht.com/203.208.46.29
address=/googleusercontent.com/203.208.46.29
address=/gstatic.com/203.208.46.29
address=/google.com.hk/203.208.46.29
address=/google.com/203.208.46.29
address=/youtube.com/203.208.46.29
address=/ytimg.com/203.208.46.29
这种

[Windows]Can't write to .symlink

On Windows, if the hosts file is a symbolic link, the program would fail to update with error "you do not have permissions to change the hosts file", even if run as administrator & UAC turned off and the file can be actually written by notepad.

the hosts doesn't work

I can't use the google today suddenly, anyone konw how it could be?
I didn't change anything before.

youtube video playback

youtube.com works fine, is accessible, but none of the videos that I've tried work. I press play and the youtube indicator spins forever. After a long time an error is shown.
1
2

Is there anything else I need to do to allow youtube video playback when in China using these hosts?

cdn is blocked

Great Fire stuff made me sick, cdn is blocked, leading to firefox add-ons completely unusable. Any ideas?

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.