查看 C:\WINDOWS\system32\drivers\etc\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 rhino.acme.com # source server # 38.25.63.10 x.acme.com # x client host127.0.0.1 localhost
# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 这里不是说了DNS会自己识别,为什么还要自己写上。。
C:\WINDOWS\system32\drivers\etc\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 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host127.0.0.1 localhost
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
这里不是说了DNS会自己识别,为什么还要自己写上。。
你的127.0.0.1和你的localhost不是一个东西啊
最后一行
127.0.0.1 localhost
你的DNS解析的lcalhost肯定不是你的机器(就算DNS默认配置了localhost也是DNS自己),你想,每台机器都叫localhost,你的DNS能智能地解析成哪台机器(除非DNS配置了解析到某台机器,否则DNS也解析不了)?
所以,这种情况,修改你的hosts文件,打开
127.0.0,1 localhost
就可以了