如何使用计算机的主机文件来阻止大量恶意软件,色情和其他类型的网站

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.

主机文件是每次连接到域名时计算机都会检查的简单文本文档,这意味着您可以使用该文件将请求重定向到您希望计算机无法访问的站点。 我们已经向您展示了如何在Windows,macOS或Linux上编辑主机文件 ; 这是在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文件 ,然后将此单行添加到文档末尾:

0.0.0.0 www.facebook.com

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 work? The text we added, 0.0.0.0 www.facebook.com, 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.

那为什么行得通呢? 我们添加的文本0.0.0.0 www.facebook.com是两件事: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/

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值