一.HOSTS工作原理:
我 们喜欢某个网站,通常会记下它的域名以便下次访问,因为域名比IP更容易被记住。hosts文件里存放的是一些常用的网站主机的域名和其对应的IP地址, 它是用来提高解析效率的。当我们通过浏览器或者ping某个域名时,系统会首先检查本地的hosts文件是否已经有相应的域名与IP地址的映射关系,如果 有就会直接采用,如果没有,再向已知的DNS服务器(Domain Name Server)请求进行域名解析完成域名与IP的转换工作。也就是说最终网络上是通过IP来辨认你要访问的目标网站的。
通 常,我们访问不了Google、Twitter、Facebook之类的是因为有我们强大的Great FireWall(GFW)进行了DNS劫持和DNS污染。GFW会对DNS的解析过程进行干扰,这会使对某些被干扰的域名返回一个错误的IP地址给你的 主机,使你无法正确连接到你要的服务器,或者请求后返回不是原有的数据。当我们直接将 IP放入Hosts文件后,就可以跳过DNS的解析这一步,直接就行IP访问,翻过GFW。
但是,GFW也会对一些“重点”网站进行IP封锁,也就是说,GFW直接拦截带有某个IP头的数据包。所以,假如你更改的某域名对应的那个IP被封锁了,即便你过了DNS这一关,也仍旧不能翻过GFW。
这就是为什么hosts的IP时不时update的原因。
Linux装完后,系统自带的hosts文件内容如下:
127.0.0.1 localhost 127.0.1.1 pangolin # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
二.修改方法:(hosts文件在最后)(注意:修改hosts文件应以追加方式修改(即在文件末尾添加))
(1).Windows:
在Windows系统里,打开C:\WINDOWS\system32\drivers\etc\hosts文件,在末尾添加如下内容,然后重启电脑即可,腾讯管家、360卫士、金山卫士可能会提示病毒或非法修改系统,请不必理会,并将Hosts文件加入白名单。
(2).linux:
hosts位置不同而已,hosts文件在/etc/hosts,用文本编辑器进入hosts文件即可:如:
vim /etc/hosts
PS:注意要在root权限下才能修改。
(3).其它操作系统:
安卓(Android)手机系统的hosts文件在:system\etc\目录下;Mac和linux一样。
三.修改完毕后:
修改完毕后应该刷新 DNS 缓存。
刷新DNS缓存方法:
Windows: 按下 Windows+R 键,运行 cmd ,运行命令 ipconfig /flushdns(然后关机重启电脑)
linux下: 在终端运行命令:sudo /etc/init.d/networking restart (linux下好像每次开机后都要运行此命令,至少我的ubantu是这样的)(后来又不用刷新了,哈哈)
OS X 10.10: 在[应用程序][实用工具][终端]运行命令:
sudo discoveryutil udnsflushcaches
OS X 10.9: 在[应用程序][实用工具][终端]运行命令:
dscacheutil -flushcache; sudo killall -HUP mDNSResponder
OS X 10.7 ~ 10.8: 在[应用程序][实用工具][终端]运行命令 :
sudo killall -HUP mDNSResponder
Android、iOS: 重新启动设备
成功访问谷歌截图:
以下是百度结果:
四.参考资料:
http://htcui.com/4938.html
http://www.williamlong.info/archives/3983.html
五.hosts文件:(因为这里不能上传文件,所以要详细文件的可以找我要哟。QQ:1924224891)
以下是简单版的,有时候可能会访问不了,如果你用下面的文件访问不了,就来找我要详细文件吧
#Google Services START
64.233.162.83 0.docs.google.com
64.233.162.83 0.drive.google.com
64.233.162.83 1.docs.google.com
64.233.162.83 1.drive.google.com
64.233.162.83 10.docs.google.com
64.233.162.83 10.drive.google.com
64.233.162.83 11.docs.google.com
64.233.162.83 11.drive.google.com
64.233.162.83 12.docs.google.com
64.233.162.83 12.drive.google.com
64.233.162.83 13.docs.google.com
64.233.162.83 13.drive.google.com
64.233.162.83 14.docs.google.com
64.233.162.83 14.drive.google.com
64.233.162.83 15.docs.google.com
64.233.162.83 15.drive.google.com
64.233.162.83 16.docs.google.com
64.233.162.83 16.drive.google.com
64.233.162.83 2.docs.google.com
64.233.162.83 2.drive.google.com
64.233.162.83 3.docs.google.com
64.233.162.83 3.drive.google.com
64.233.162.83 4.docs.google.com
64.233.162.83 4.drive.google.com
64.233.162.83 5.docs.google.com
64.233.162.83 5.drive.google.com
64.233.162.83 6.docs.google.com
64.233.162.83 6.drive.google.com
64.233.162.83 7.docs.google.com
64.233.162.83 7.drive.google.com
64.233.162.83 8.docs.google.com
64.233.162.83 8.drive.google.com
64.233.162.83 9.docs.google.com
64.233.162.83 9.drive.google.com
64.233.162.83 accounts.google.com
64.233.162.83 accounts.l.google.com
64.233.162.83 answers.google.com
64.233.162.83 apis.google.com
64.233.162.83 appengine.google.com
64.233.162.83 apps.google.com
64.233.162.83 appspot.l.google.com
64.233.162.83 bks0.books.google.com
64.233.162.83 bks1.books.google.com
64.233.162.83 bks10.books.google.com
64.233.162.83 bks2.books.google.com
64.233.162.83 bks3.books.google.com
64.233.162.83 bks4.books.google.com
64.233.162.83 bks5.books.google.com
64.233.162.83 bks6.books.google.com
64.233.162.83 bks7.books.google.com
64.233.162.83 bks8.books.google.com
64.233.162.83 bks9.books.google.com
64.233.162.83 blogsearch.google.com
64.233.162.83 books.google.com
64.233.162.83 browserchannel-docs.l.google.com
64.233.162.83 browserchannel-spreadsheets.l.google.com
64.233.162.83 browsersync.google.com
64.233.162.83 browsersync.l.google.com
64.233.162.83 buzz.google.com
64.233.162.83 cache.l.google.com
64.233.162.83 cache.pack.google.com
64.233.162.83 calendar.google.com
64.233.162.83 cbk0.google.com
64.233.162.83 cbk1.google.com
64.233.162.83 cbk2.google.com
64.233.162.83 cbk3.google.com
64.233.162.83 cbks0.google.com
64.233.162.83 cbks1.google.com
64.233.162.83 cbks2.google.com
64.233.162.83 cbks3.google.com
64.233.162.83 chart.apis.google.com
64.233.162.83 chatenabled.mail.google.com
64.233.162.83 checkout.google.com
64.233.162.83 checkout.l.google.com
64.233.162.83 chrome.google.com
64.233.162.83 clients.l.google.com
64.233.162.83 clients1.google.com
64.233.162.83 clients2.google.com
64.233.162.83 clients3.google.com
64.233.162.83 clients4.google.com
64.233.162.83 clients5.google.com
64.233.162.83 clients6.google.com
64.233.162.83 clients7.google.com
64.233.162.83 code.google.com
64.233.162.83 code.l.google.com
64.233.162.83 csi.l.google.com
64.233.162.83 desktop.google.com
64.233.162.83 desktop.l.google.com
64.233.162.83 desktop2.google.com
64.233.162.83 developers.google.com
64.233.162.83 ditu.google.com
64.233.162.83 dl.google.com
64.233.162.83 dl.l.google.com
64.233.162.83 dl-ssl.google.com
64.233.162.83 docs.google.com
64.233.162.83 docs0.google.com
64.233.162.83 docs1.google.com
64.233.162.83 docs2.google.com
64.233.162.83 docs3.google.com
64.233.162.83 docs4.google.com
64.233.162.83 docs5.google.com
64.233.162.83 docs6.google.com
64.233.162.83 docs7.google.com
64.233.162.83 docs8.google.com
64.233.162.83 docs9.google.com
64.233.162.83 drive.google.com
64.233.162.83 drive0.google.com
64.233.162.83 drive1.google.com
64.233.162.83 drive2.google.com
64.233.162.83 drive3.google.com
64.233.162.83 drive4.google.com
64.233.162.83 drive5.google.com
64.233.162.83 drive6.google.com
64.233.162.83 drive7.google.com
64.233.162.83 drive8.google.com
64.233.162.83 drive9.google.com
64.233.162.83 earth.google.com
64.233.162.83 encrypted.google.com
64.233.162.83 encrypted-tbn.l.google.com
64.233.162.83 encrypted-tbn0.google.com
64.233.162.83 encrypted-tbn1.google.com
64.233.162.83 encrypted-tbn2.google.com
64.233.162.83 encrypted-tbn3.google.com
64.233.162.83 feedburner.google.com
64.233.162.83 feedproxy.google.com
64.233.162.83 filetransferenabled.mail.google.com
64.233.162.83 finance.google.com
64.233.162.83 fusion.google.com
64.233.162.83 geoauth.google.com
64.233.162.83 gg.google.com
64.233.162.83 ghs.google.com
64.233.162.83 ghs.l.google.com
64.233.162.83 ghs46.google.com
64.233.162.83 ghs46.l.google.com
64.233.162.83 google.com
64.233.162.83 googleapis.l.google.com
64.233.162.83 googleapis-ajax.google.com
64.233.162.83 googleapis-ajax.l.google.com
64.233.162.83 googlecode.l.google.com
64.233.162.83 google-public-dns-a.google.com
64.233.162.83 google-public-dns-b.google.com
64.233.162.83 goto.google.com
64.233.162.83 groups.google.com
64.233.162.83 groups.l.google.com
64.233.162.83 groups-beta.google.com
64.233.162.83 gxc.google.com
64.233.162.83 id.google.com
64.233.162.83 id.l.google.com
64.233.162.83 images.google.com
64.233.162.83 images.l.google.com
64.233.162.83 investor.google.com
64.233.162.83 jmt0.google.com
64.233.162.83 kh.google.com
64.233.162.83 kh.l.google.com
64.233.162.83 khm.google.com
64.233.162.83 khm.l.google.com
64.233.162.83 khm0.google.com
64.233.162.83 khm1.google.com
64.233.162.83 khm2.google.com
64.233.162.83 khm3.google.com
64.233.162.83 khmdb.google.com
64.233.162.83 khms.google.com
64.233.162.83 khms.l.google.com
64.233.162.83 khms0.google.com
64.233.162.83 khms1.google.com
64.233.162.83 khms2.google.com
64.233.162.83 khms3.google.com
64.233.162.83 labs.google.com
64.233.162.83 large-uploads.l.google.com
64.233.162.83 lh2.google.com
64.233.162.83 lh2.l.google.com
64.233.162.83 lh3.google.com
64.233.162.83 lh4.google.com
64.233.162.83 lh5.google.com
64.233.162.83 lh6.google.com
64.233.162.83 linkhelp.clients.google.com
64.233.162.83 local.google.com
64.233.162.83 m.google.com
64.233.162.83 mail.google.com
64.233.162.83 map.google.com
64.233.162.83 maps.google.com
64.233.162.83 maps.l.google.com
64.233.162.83 maps-api-ssl.google.com
64.233.162.83 mars.google.com
64.233.162.83 mobile.l.google.com
64.233.162.83 mobile-gtalk.l.google.com
64.233.162.83 mobilemaps.clients.google.com
64.233.162.83 mt.google.com
64.233.162.83 mt.l.google.com
64.233.162.83 mt0.google.com
64.233.162.83 mt1.google.com
64.233.162.83 mt2.google.com
64.233.162.83 mt3.google.com
64.233.162.83 mtalk.google.com
64.233.162.83 mts.google.com
64.233.162.83 mts.l.google.com
64.233.162.83 mts0.google.com
64.233.162.83 mts1.google.com
64.233.162.83 mts2.google.com
64.233.162.83 mts3.google.com
64.233.162.83 music.google.com
64.233.162.83 music-streaming.l.google.com
64.233.162.83 mw1.google.com
64.233.162.83 mw2.google.com
64.233.162.83 news.google.com
64.233.162.83 news.l.google.com
64.233.162.83 pack.google.com
64.233.162.83 photos.google.com
64.233.162.83 photos-ugc.l.google.com
64.233.162.83 picasa.google.com
64.233.162.83 picasaweb.google.com
64.233.162.83 picasaweb.l.google.com
64.233.162.83 places.google.com
64.233.162.83 play.google.com
64.233.162.83 productforums.google.com
64.233.162.83 profiles.google.com
64.233.162.83 reader.google.com
64.233.162.83 safebrowsing.cache.l.google.com
64.233.162.83 safebrowsing.clients.google.com
64.233.162.83 safebrowsing.google.com
64.233.162.83 safebrowsing-cache.google.com
64.233.162.83 sandbox.google.com
64.233.162.83 sb.google.com
64.233.162.83 sb.l.google.com
64.233.162.83 sb-ssl.google.com
64.233.162.83 sb-ssl.l.google.com
64.233.162.83 scholar.google.com
64.233.162.83 scholar.l.google.com
64.233.162.83 script.google.com
64.233.162.83 services.google.com
64.233.162.83 sites.google.com
64.233.162.83 sketchup.google.com
64.233.162.83 sketchup.l.google.com
64.233.162.83 spreadsheet.google.com
64.233.162.83 spreadsheets.google.com
64.233.162.83 spreadsheets.l.google.com
64.233.162.83 spreadsheets0.google.com
64.233.162.83 spreadsheets1.google.com
64.233.162.83 spreadsheets2.google.com
64.233.162.83 spreadsheets3.google.com
64.233.162.83 spreadsheets4.google.com
64.233.162.83 spreadsheets5.google.com
64.233.162.83 spreadsheets6.google.com
64.233.162.83 spreadsheets7.google.com
64.233.162.83 spreadsheets8.google.com
64.233.162.83 spreadsheets9.google.com
64.233.162.83 spreadsheets-china.l.google.com
64.233.162.83 suggestqueries.google.com
64.233.162.83 suggestqueries.l.google.com
64.233.162.83 support.google.com
64.233.162.83 talk.google.com
64.233.162.83 talkgadget.google.com
64.233.162.83 tbn0.google.com
64.233.162.83 tbn1.google.com
64.233.162.83 tbn2.google.com
64.233.162.83 tbn3.google.com
64.233.162.83 toolbar.google.com
64.233.162.83 toolbarqueries.clients.google.com
64.233.162.83 toolbarqueries.google.com
64.233.162.83 toolbarqueries.l.google.com
64.233.162.83 tools.google.com
64.233.162.83 tools.l.google.com
64.233.162.83 translate.google.com
64.233.162.83 trends.google.com
64.233.162.83 upload.docs.google.com
64.233.162.83 upload.drive.google.com
64.233.162.83 uploads.code.google.com
64.233.162.83 uploadsj.clients.google.com
64.233.162.83 v3.cache1.c.docs.google.com
64.233.162.83 video.google.com
64.233.162.83 video-stats.l.google.com
64.233.162.83 voice.google.com
64.233.162.83 wallet.google.com
64.233.162.83 wifi.google.com
64.233.162.83 wifi.l.google.com
64.233.162.83 wire.l.google.com
64.233.162.83 writely.google.com
64.233.162.83 writely.l.google.com
64.233.162.83 writely-china.l.google.com
64.233.162.83 writely-com.l.google.com
64.233.162.83 www.google.com
64.233.162.83 www.l.google.com
64.233.162.83 www2.l.google.com
64.233.162.83 www3.l.google.com
64.233.162.83 www4.l.google.com
64.233.162.83 ytstatic.l.google.com
64.233.162.83 0-open-opensocial.googleusercontent.com
64.233.162.83 0-focus-opensocial.googleusercontent.com
64.233.162.83 1-focus-opensocial.googleusercontent.com
64.233.162.83 1-open-opensocial.googleusercontent.com
64.233.162.83 1-ps.googleusercontent.com
64.233.162.83 2-focus-opensocial.googleusercontent.com
64.233.162.83 2-open-opensocial.googleusercontent.com
64.233.162.83 2-ps.googleusercontent.com
64.233.162.83 3-focus-opensocial.googleusercontent.com
64.233.162.83 3-ps.googleusercontent.com
64.233.162.83 3-open-opensocial.googleusercontent.com
64.233.162.83 4-ps.googleusercontent.com
64.233.162.83 a-oz-opensocial.googleusercontent.com
64.233.162.83 blogger.googleusercontent.com
64.233.162.83 clients1.googleusercontent.com
64.233.162.83 clients2.googleusercontent.com
64.233.162.83 clients3.googleusercontent.com
64.233.162.83 clients4.googleusercontent.com
64.233.162.83 clients5.googleusercontent.com
64.233.162.83 clients6.googleusercontent.com
64.233.162.83 clients7.googleusercontent.com
64.233.162.83 feedback.googleusercontent.com
64.233.162.83 googlehosted.l.googleusercontent.com
64.233.162.83 gp0.googleusercontent.com
64.233.162.83 gp1.googleusercontent.com
64.233.162.83 gp2.googleusercontent.com
64.233.162.83 gp3.googleusercontent.com
64.233.162.83 gp4.googleusercontent.com
64.233.162.83 gp5.googleusercontent.com
64.233.162.83 gp6.googleusercontent.com
64.233.162.83 images1-focus-opensocial.googleusercontent.com
64.233.162.83 images2-focus-opensocial.googleusercontent.com
64.233.162.83 images3-focus-opensocial.googleusercontent.com
64.233.162.83 images4-focus-opensocial.googleusercontent.com
64.233.162.83 images5-focus-opensocial.googleusercontent.com
64.233.162.83 images6-focus-opensocial.googleusercontent.com
64.233.162.83 images7-focus-opensocial.googleusercontent.com
64.233.162.83 images8-focus-opensocial.googleusercontent.com
64.233.162.83 images9-focus-opensocial.googleusercontent.com
64.233.162.83 images-docs-opensocial.googleusercontent.com
64.233.162.83 images-oz-opensocial.googleusercontent.com
64.233.162.83 lh1.googleusercontent.com
64.233.162.83 lh2.googleusercontent.com
64.233.162.83 lh3.googleusercontent.com
64.233.162.83 lh4.googleusercontent.com
64.233.162.83 lh5.googleusercontent.com
64.233.162.83 lh6.googleusercontent.com
64.233.162.83 mail-attachment.googleusercontent.com
64.233.162.83 music.googleusercontent.com
64.233.162.83 music-onebox.googleusercontent.com
64.233.162.83 oauth.googleusercontent.com
64.233.162.83 s1.googleusercontent.com
64.233.162.83 s2.googleusercontent.com
64.233.162.83 s3.googleusercontent.com
64.233.162.83 s4.googleusercontent.com
64.233.162.83 s5.googleusercontent.com
64.233.162.83 s6.googleusercontent.com
64.233.162.83 spreadsheets-opensocial.googleusercontent.com
64.233.162.83 static.googleusercontent.com
64.233.162.83 t.doc-0-0-sj.sj.googleusercontent.com
64.233.162.83 themes.googleusercontent.com
64.233.162.83 translate.googleusercontent.com
64.233.162.83 webcache.googleusercontent.com
64.233.162.83 www.googleusercontent.com
64.233.162.83 www-calendar-opensocial.googleusercontent.com
64.233.162.83 www-fc-opensocial.googleusercontent.com
64.233.162.83 www-focus-opensocial.googleusercontent.com
64.233.162.83 www-gm-opensocial.googleusercontent.com
64.233.162.83 www-kix-opensocial.googleusercontent.com
64.233.162.83 www-open-opensocial.googleusercontent.com
64.233.162.83 www-opensocial.googleusercontent.com
64.233.162.83 www-opensocial-sandbox.googleusercontent.com
64.233.162.83 www-oz-opensocial.googleusercontent.com
64.233.162.83 csi.gstatic.com
64.233.162.83 g0.gstatic.com
64.233.162.83 g1.gstatic.com
64.233.162.83 g2.gstatic.com
64.233.162.83 g3.gstatic.com
64.233.162.83 maps.gstatic.com
64.233.162.83 mt0.gstatic.com
64.233.162.83 mt1.gstatic.com
64.233.162.83 mt2.gstatic.com
64.233.162.83 mt3.gstatic.com
64.233.162.83 mt4.gstatic.com
64.233.162.83 mt5.gstatic.com
64.233.162.83 mt6.gstatic.com
64.233.162.83 mt7.gstatic.com
64.233.162.83 ssl.gstatic.com
64.233.162.83 t0.gstatic.com
64.233.162.83 t1.gstatic.com
64.233.162.83 t2.gstatic.com
64.233.162.83 t3.gstatic.com
64.233.162.83 www.gstatic.com
64.233.162.83 lh1.ggpht.com
64.233.162.83 lh2.ggpht.com
64.233.162.83 lh3.ggpht.com
64.233.162.83 lh4.ggpht.com
64.233.162.83 lh5.ggpht.com
64.233.162.83 lh6.ggpht.com
64.233.162.83 nt0.ggpht.com
64.233.162.83 nt1.ggpht.com
64.233.162.83 nt2.ggpht.com
64.233.162.83 nt3.ggpht.com
64.233.162.83 nt4.ggpht.com
64.233.162.83 nt5.ggpht.com
64.233.162.83 appspot.com
64.233.162.83 www.appspot.com
64.233.162.83 ajax.googleapis.com
64.233.162.83 chart.googleapis.com
64.233.162.83 fonts.googleapis.com
64.233.162.83 maps.googleapis.com
64.233.162.83 mt0.googleapis.com
64.233.162.83 mt1.googleapis.com
64.233.162.83 mt2.googleapis.com
64.233.162.83 mt3.googleapis.com
64.233.162.83 redirector-bigcache.googleapis.com
64.233.162.83 translate.googleapis.com
64.233.162.83 www.googleapis.com
64.233.162.83 autoproxy-gfwlist.googlecode.com
64.233.162.83 chromium.googlecode.com
64.233.162.83 closure-library.googlecode.com
64.233.162.83 earth-api-samples.googlecode.com
64.233.162.83 gmaps-samples-flash.googlecode.com
64.233.162.83 google-code-feed-gadget.googlecode.com
64.233.162.83 accounts.google.com.hk
64.233.162.83 blogsearch.google.com.hk
64.233.162.83 books.google.com.hk
64.233.162.83 clients1.google.com.hk
64.233.162.83 desktop.google.com.hk
64.233.162.83 encrypted.google.com.hk
64.233.162.83 groups.google.com.hk
64.233.162.83 gxc.google.com.hk
64.233.162.83 id.google.com.hk
64.233.162.83 images.google.com.hk
64.233.162.83 m.google.com.hk
64.233.162.83 maps.google.com.hk
64.233.162.83 news.google.com.hk
64.233.162.83 picasaweb.google.com.hk
64.233.162.83 plus.url.google.com.hk
64.233.162.83 scholar.google.com.hk
64.233.162.83 toolbar.google.com.hk
64.233.162.83 toolbarqueries.google.com.hk
64.233.162.83 translate.google.com.hk
64.233.162.83 translate.google.com.hk
64.233.162.83 wenda.google.com.hk
64.233.162.83 www.google.com.hk
64.233.162.83 accounts.blogger.com
64.233.162.83 android.googlesource.com
64.233.162.83 auth.keyhole.com
64.233.162.83 chrome.angrybirds.com
64.233.162.83 developer.android.com
64.233.162.83 domains.googlesyndication.com
64.233.162.83 earthengine.googlelabs.com
64.233.162.83 feeds.feedburner.com
64.233.162.83 g.co
64.233.162.83 goo.gl
64.233.162.83 listen.googlelabs.com
64.233.162.83 m.googlemail.com
64.233.162.83 market.android.com
64.233.162.83 ngrams.googlelabs.com
64.233.162.83 panoramio.com
64.233.162.83 ssl.google-analytics.com
64.233.162.83 static.panoramio.com
64.233.162.83 www.blogger.com
64.233.162.83 www.googleadservices.com
64.233.162.83 www.google-analytics.com
64.233.162.83 www.googlelabs.com
64.233.162.83 www.googlesource.com
64.233.162.83 www.panoramio.com
64.233.162.83 plus.google.com
64.233.162.83 plus.url.google.com
64.233.162.83 plusone.google.com
64.233.162.83 security.google.com
64.233.162.83 myaccount.google.com
173.194.192.109 imap.gmail.com
173.194.192.109 pop.gmail.com
173.194.193.108 smtp.gmail.com
#Google Services END
全球各大受限网站验证区/导航,点击下方图标打开验证