通过了Win10原HOST文件内容,可清晰区分系统默认状态与自定义配置,避免因误改导致网络析异常。如需添加域名映射,需“IP+域名”格式,且每行仅配置一条规则。
Win10的hosts文件原始内容是什么?
Win10原HOST文件内容析
Hosts文件是Windows系统中用于域名析的本地配置文件,通过IP地址与域名的映射关系,优先级高于DNS服务器。Win10原HOST文件内容默认状态下以释为主,自定义析规则,以下是其整内容及析:
Win10原HOST文件默认内容
```html
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
```
关键特征说明
1. 纯释内容:原始文件中所有有效行均以`#`,仅用于说明文件用途、格式规范及示例,实际IP与域名映射规则。
2. 本地回环地址释:默认释了`127.0.0.1 localhost`IPv4和`::1 localhost`IPv6,即本地回环地址与主机名的映射,需手动取消释才能生效。
3. 格式规范提示:明确标“IP地址+空格+域名”的基本格式,以及`#`用于添加释的规则。
Win10 HOSTS文件路径
文件默认路径为:
```html
C:WindowsSystem32driversetchosts
```
需通过管理员权限打开编辑如右键记事本选择“以管理员身份运行”。
如何查看和恢复原始内容
若文件被修改,可通过以下方式恢复默认内容:
1. 复制上方默认内容覆盖现有文件;
2. 从系统备份或Windows安装镜像中提取原始文件替换。
