Whether you’ve given a computer to your child or just want to keep things clean on your own machine, blocking sites that serve malware, porn, social networking, and gambling en masse is useful. And while there’s lots of third party software out there for the job, the hosts file is a built-in option for every major operating system.
无论您是为孩子提供一台计算机,还是只是想让自己的机器保持清洁,阻止恶意软件,色情, 交 络和大规模赌博 站都非常有用。 尽管有很多第三方软件可以工作,但是hosts文件是每个主要操作系统的内置选项。
The hosts file is a simple text document checked by your computer every time you connect to a domain name, meaning you can use it to redirect requests to sites you’d rather your computer not be able to access. We’ve shown you how to edit your hosts file on Windows, macOS, or Linux; here’s how to use that power to block entire categories of websites on any machine using a beautifully curated list found on Github.
如何阻止一个 站 (How to Block a Single Website)
Let’s say you want to block an individual site, like Facebook. Doing this is relatively straightforward. First, open your hosts file, then add this single line to the end of the document:
假设您要屏蔽单个 站,例如Facebook。 这样做相对简单。 首先, 打开您的hosts文件 ,然后将此单行添加到文档末尾:
Save the document, and you will no longer be able to access Facebook in any browser. (If you can, try clearing your DNS cache or restarting your computer.)
保存该文档,您将无法再使用任何浏览器访问Facebook。 (如果可以,请尝试清除DNS缓存或重新启动计算机。)
So why does this workThe text we added, , is two things: an IP address followed by a URL. By adding these two things in order, we’re telling the computer to route all requests for facebook.com to the IP address 0.0.0.0, which is not a routable address. The result: the site fails to load.
那为什么行得通呢我们添加的文本是两件事:IP地址和URL。 通过依次添加这两件事,我们告诉计算机将对facebook.com的所有请求路由到IP地址0.0.0.0,这不是可路由的地址。 结果:该站点无法加载。
That’s the basic principle. Now let’s soup this approach up and block everything.
这是基本原则。 现在,让我们来探讨一下这种方法并阻止所有操作。
…Everything.
…… 一切 。
整批阻止恶意软件,色情和赌博 站 (Block Malware, Porn, and Gambling Sites En Masse)
If you want to block entire categories of websites—malware, say, or porn—you’ve first got to track down every single URL associated with those activities. Happily, the unified hosts file repo on Github has done this work for you. A curated list combining the efforts of many other communities, this page offers hosts files for blocking several combinations of categories.
如果要阻止整个类别的 站(例如恶意软件,色情 站或色情 站),则必须首先跟踪与这些活动相关的每个URL。 幸运的是, Github上的统一主机文件存储库已为您完成了这项工作。 此页面是一个精心策划的列表,结合了许多其他 区的工作,此页面提供了用于阻止几种类别组合的主机文件。
All of the files block adware and malware, but many block other things such as porn, gambling, fake news, and even social networks. Find the combination of things you’d like to block, then click the link to the raw hosts file.
所有文件均阻止广告软件和恶意软件,但许多文件阻止其他内容,例如色情,赌博,假新闻甚至 交 络。 找到您要阻止的内容的组合,然后单击指向原始主机文件的链接。
Select all the text, copy it, then paste it in your hosts file. Your computer will now block all of these things.
选择所有文本,将其复制,然后将其粘贴到您的主机文件中。 您的计算机现在将阻止所有这些事情。
That’s right: no more porn. No gambling either. Guess you’ll just have to do some work.
是的:不再色情。 也不赌博。 猜猜你只需要做一些工作。
翻译自: https://www.howtogeek.com/319700/how-to-use-your-computers-hosts-file-to-block-tons-of-malware-porn-and-other-types-of-websites/
文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览92145 人正在系统学习中 相关资源:Veneer:文件屏蔽软件-开源-其它代码类资源-CSDN文库
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!