导读:(hosts文件有什么作用?win10系统下hosts文件出错的修复方法)相关电脑教程分享。
hosts文件有什么用?1、加快域名解析
对于要经常访问的网站,可以通过在Hosts中配置域名和IP的映射关系,这样当输入域名计算机就能很快解析出IP,而不用请求网络上的DNS服务器。2、方便局域网用户
在很多单位的局域网中,会有服务器提供给用户使用。但由于局域网中一般很少架设DNS服务器,访问这些服务要输入难记的IP地址,对不少人来说相当麻烦。现在可以分别给这些服务器取个容易记住的名字,然后在Hosts中建立IP映射,这样以后访问的时候输入这个服务器的名字就行了。
3、屏蔽网站现在有很多网站不经过用户同意就将各种各样的插件安装到计算机中,有些说不定就是木马或病毒。对于这些网站可以利用Hosts把该网站的域名映射到错误的IP或自己计算机的IP,这样就不用访问了。
所以一旦hosts文件出错,那么很多网络功能将会变得不正常。那么如果出错了我们该如何修复呢?方法一:
1、打开此电脑,在此电脑中依次展开:C:\Windows\System32\drivers\etc,在ect文件夹中找到hosts文件,单击右键,选择打开方式,然后选择记事本,点击确定;#
# 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.1localhost
# ::1localhost
将原文件中的代码替换。保存退出即可。1、打开此电脑,在此电脑中依次展开:C:\Windows\System32\drivers\etc,在ect文件夹中找到hosts文件删除。
……