如何使用 Host 来禁用一个网址?

· · 个人记录

前言

你家孩子爱打游戏吗?你家孩子会偷偷上网打游戏吗?你有办法去制止吗?

如果你还苦衷与此,那么请接着读下去…… (像推销的?)

正文

  1. 首先按下键盘上的Windows+R键。

  2. 在弹出的对话框里输入C:\WINDOWS\system32\drivers\etc,再点击“确定”。

  1. 点击文件夹中的“hosts”文件

  1. 用记事本打开

  1. 输入你想要禁用的网址(以百度为例)

格式:0.0.0.0(或者127.0.0.1)+空格+你要屏蔽的网站的域名

  1. 点击保存

(如果电脑装有360安全卫士,一定要点击允许更改“hosts”文件,要不然没用)

  1. 这个网址就被禁用啦!

后记

玩坏了吧,下面是“hosts”文件的原样,记得还原哦~

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost