由于工作的关系,或者安装一些软件,需要修改hosts文件,hosts文件的作用是将一些常用的网址域名与其对应的IP地址建立一个关联。不过很多用户并不知道如何修改hosts文件,本文就给大家详细介绍Win10系统修改hosts文件的方法,在介绍修改之前,先告诉大家如何查找hosts文件。

  查找hosts文件

  1、首先,打开桌面的“我的电脑”,或者是通过开始菜单进入到我的电脑;

  2、之后,进入到“C:\Windows\System32\drivers\etc”目录下,这个时候会看到目录下有一个“hosts”文件,这个就是所谓的hosts文件;

  3、在xp以及03系统下hosts文件的路径有点不同,这两个系统需要进入到“C:\Windows\System32\drivers\etc”目录下,即可找到对应的hosts文件。(默认位置为%SystemRoot%\system32\drivers\etc\)

  修改hosts文件

  1、进入到该目录下之后,双击打开该文件。如下图,弹出“打开方式”窗口,选择以“记事本”打开。

  2、以文本的方式打开hosts文件之后,原始的hosts文件内容如下:

# Copyright (c) 1993-2009 Microsoft Corp.

#

# This is a sample HOSTS file used by Microsoft TCPIP 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.630 x.acme.com # x client host

# localhost name resolution is handled within DNS itself.