admin 管理员组

文章数量: 1184232


2024年4月13日发(作者:数据结构教程易法令)

Hosts文件是一个用于存储计算机网络中节点信息的文件,它可以将主机名映射到相

应的IP地址,实现DNS的功能,它可以由计算机的用户进行控制。

一、Hosts文件基本介绍

Hosts文件的存储位置在不同的操作系统中并不相同,甚至不同Windows版本的位

置也不大一样:

Windows NT/2000/XP/2003/Vista/win7:默认位置

为%SystemRoot%system32driversetc,但也可以改变。

例如 c:windowssystem32driversetc

动态目录由注册表键HKEY_LOCAL_MACHINESYSTEMCurrentControlSet

ServicesTcpipParametersDataBasePath决定。

Windows 95/98/Me:%WinDir%

用记事本打开hosts文件,就可以看见了微软对这个文件的说明。Hosts文件文一般

有如下面的基本内容

# Copyright (c) 1993-1999 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 # source server


本文标签: 文件 实现 基本 节点