Google某些网址访问不了的解决方法

来源:互联网 发布:玉米 番薯 知乎 编辑:程序博客网 时间:2024/06/03 01:23

偶尔用http://code.google.com的功能,但是常常碰到访问不了的情况,之前有通过改hosts文件解决,但总过那么一段时间就又不行了,又得想办法来解决,后来发现Google的IP变了,将hosts文件中对应的Google的IP改掉就行了,具体方法如下:

首先要找到hosts文件,在Windows上位于C:\Windows\System32\drivers\etc\hosts,Linux上貌似是etc/hosts。由于是系统文件,所以普通用户没有权限修改它,我们得先改它的权限。选中右击它,选择属性,然后选择安全选项卡,可以看到普通用户只有可读的权限,如图

点击“编辑”按钮,


选中当前用户所在组(Users),点击将完全控制等权限都勾上,然后都点击确认即可,这时就可以编辑hosts文件并保存了。

接下来编辑hosts文件,在文件末尾加上如下内容:

74.125.71.103 code.google.com 
74.125.71.103 encrypted.google.com 
74.125.71.103 suggestqueries.google.com 
74.125.71.103 mail.google.com 
74.125.71.103 groups.google.com 
74.125.71.103 groups.google.com.hk 
74.125.71.103 docs0.google.com 
74.125.71.103 docs1.google.com 
74.125.71.103 spreadsheets.google.com 
74.125.71.103 spreadsheets0.google.com 
74.125.71.103 webcache.googleusercontent.com 
74.125.71.103 sites.google.com 
74.125.71.103 talkgadget.google.com 
74.125.71.103 clients1.google.com 
74.125.71.103 clients2.google.com 
74.125.71.103 clients3.google.com 
74.125.71.103 clients4.google.com
74.125.71.103 docs.google.com

其中74.125.71.103是当前Google的IP,通过ping www.google.com可以获得,如果之后又访问不了,再查看Google的IP是否改了,如果是改了将IP地址改成当前的即可,改好hosts文件内容后保存,为安全起见将hosts文件的权限再改回默认的设置。