windows 通过主机文件阻止网站不起作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2012356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
blocking website via hosts file not working?
提问by Parastar
I'm trying to block a website using the hosts file using this tutorial : http://hackspc.com/how-to-block-a-website/
我正在尝试使用本教程使用主机文件阻止网站:http: //hackspc.com/how-to-block-a-website/
but It doesn't work, the website I'v blocked In this case facebook still shows up, please can anyone help me out here?
但它不起作用,我屏蔽的网站在这种情况下,facebook 仍然出现,请有人帮我吗?
回答by K Singh
link textI could not access the link (blocked in office) but i think this may help you edit your host file "“WWW” has become the universal standard for the default host. It is just as common to define a site with no host as well. This means that as far as DNS goes www.yahoo.com & yahoo.com are two totally different sites, even though they resolve to the same place. Because of this to effectively block the site, you must also block all hosts. This would usually mean:
链接文本我无法访问链接(在办公室被阻止)但我认为这可能有助于您编辑您的主机文件““WWW”已成为默认主机的通用标准。定义没有主机的站点同样常见同样。这意味着就 DNS 而言,www.yahoo.com 和 yahoo.com 是两个完全不同的站点,即使它们解析到同一个地方。因此,要有效阻止该站点,您还必须阻止所有主机. 这通常意味着:
127.0.0.1 facebook.com
127.0.0.1 脸书网
127.0.0.1 www.facebook.com"
127.0.0.1 www.facebook.com"
check the linkfor more details.
查看链接了解更多详情。
Also i you trying to block multiple sites, its better to have a proper software like proxy server or firewalls which can block access to particular sites.
此外,我试图阻止多个站点,最好有一个适当的软件,如代理服务器或防火墙,可以阻止对特定站点的访问。
回答by Pekka
I think Kavitesh Singh made the most important point: Blocking the domain with and without www.
this is the most common reason for an entry not working.
我认为 Kavitesh Singh 提出了最重要的一点:无论是否有www.
此功能,都阻止域是条目不起作用的最常见原因。
Also, not all browsers immediately react to changes in the hosts
file. Have you tried re-starting your browser and / or system?
此外,并非所有浏览器都会立即对hosts
文件中的更改做出反应。您是否尝试过重新启动浏览器和/或系统?