最新消息:推荐好友购买联系客服领现金红包~

本地强制解析hosts

其他教程 主机帮助 265浏览

域名解析生效各地dns服务器同步生效需要一些时间,可以通过设置hosts的方式使域名本地解析生效。

找到自己电脑C:\Windows\System32\drivers\etc下的hosts文件,文本工具进行编辑
例如hostbz.com(替换成自己的域名)域名解析到8.8.8.8(替换成空间IP)如下,最后新增一行

# 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

8.8.8.8 www.hostbz.com hostbz.com

PS:井号是注释不生效。

转载请注明:主机帮助 » 本地强制解析hosts