一般hosts文件正确的话,hosts文件写死了的域名的解析与你启用了什么服务是无关的,很有可能是浏览器被劫持强制转向了,杀杀毒吧。
如果ping domainname的回应有reply from ***.***.***.***的话域名解析就是没问题的。
否则会有类似ping request could not find host domain的字样,再检查一下hosts有没有写正确,是不是写了正确的hosts文件,或者把lmhosts.sam,也改了再试试
或者直接用ip代替域名访问网页,一般网站的话和你用域名访问效果一样的,如果有安全保护的话也应该可以看到对应的出错提示。
# 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 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host