舞鬼十七's Blog

简单,快乐,有所追求

SyncHosts——自动联网更新hosts程序

1程序简介
由于众所周知的原因,中国的互联网用户过得很艰辛。为了更好地使用Google以及其它的一些网站提供的服务,不少用户不得不使用hosts把这些服务的域名解析到固定的IP上。由于hosts优先于DNS服务器,因而这种方法能在一定程度上帮助想获取更多信息的用户。 但是Google和其它著名网站的服务IP并不是固定的,而是时常会变化,如果hosts中的IP过期,反而会使用户无法访问,得不偿失。而有人会在Google Docs上维护这些服务网站的最新可用的IP地址,为此,我写了个自动联网获取最新IP地址更新hosts文件的程序——SyncHosts。

2程序运行条件
安装了.Net Framework3.5的Windows系统。win7系统已默认安装.Net Framework3.5。


3运行说明
如果你曾自己把Google服务域名的IP添加到hosts文件,请最好删除,以免发生冲突。
hosts文件原样:
------------------------------------------------------------
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
# 127.0.0.1       localhost
# ::1             localhost



下载SyncHosts

下载SyncHosts v1.0.1(update:2012-1-7)