修改hosts解决Google Analytics不能访问

Google Analytics 不能访问快成了 QQ 群里最热门的话题了,几乎每天都有人不停地问。Google Analytics 不能访问主要原因大家都懂,解决办法除了修炼翻墙术外还可以修改 hosts,如下:

1.创建一个空白 txt 文档
2.将下面的代码扔进去
3.保存
4.文件名改为 .bat

@echo off
pushd %windir%\system32\drivers\etc
copy  /y hosts hosts.bak
echo 173.194.72.189 www.google.com>>hosts
echo 173.194.72.160 maps.gstatic.cn>>hosts
echo 74.125.31.160  www.gstatic.cn>>hosts
echo 74.125.232.111 csi.gstatic.com>>hosts
echo 74.125.31.132  g0.gstatic.com>>hosts
echo 74.125.31.132  g1.gstatic.com>>hosts
echo 74.125.31.132  g2.gstatic.com>>hosts
echo 74.125.31.132  g3.gstatic.com>>hosts
echo 74.125.31.132  maps.gstatic.com>>hosts
echo 74.125.31.132  mt0.gstatic.com>>hosts
echo 74.125.31.132  mt1.gstatic.com>>hosts
echo 74.125.31.132  mt2.gstatic.com>>hosts
echo 74.125.31.132  mt3.gstatic.com>>hosts
echo 74.125.31.132  mt4.gstatic.com>>hosts
echo 74.125.31.132  mt5.gstatic.com>>hosts
echo 74.125.31.132  mt6.gstatic.com>>hosts
echo 74.125.31.132  mt7.gstatic.com>>hosts
echo 74.125.235.254 ssl.google-analytics.com>>hosts
echo 173.194.72.120 ssl.gstatic.com>>hosts
echo 74.125.31.120  www.gstatic.com>>hosts
echo 74.125.31.147  t0.gstatic.com>>hosts
echo 173.194.72.189 t1.gstatic.com>>hosts
echo 173.194.72.106 t2.gstatic.com>>hosts
echo 74.125.31.147  t3.gstatic.com>>hosts
echo 173.194.72.189 www.google-analytics.com>>hosts
echo 173.194.72.84  accounts.google.com>>hosts
echo 173.194.72.84  accounts.l.google.com>>hosts

大功告成,现在基本就可以访问 Google Analytics 了,点击我试试吧。如果还不行,就只能翻墙顺利登录后,将地址收藏,下次点击书签就直接可以访问了。

共享一份我在网站分析 QQ 群共享的一份 hosts_GA.bat 文件,下载可以直接点击使用。懒人下载(提取密码:3y1j)

评论