大家精晓localhost绑定的是地面主机IP(127.0.0.1),那么大家能不可能自定义绑定当地主机IP地址呢?答案是必然的,同修改hosts文件,大家得以兑现地点的需求。

本地电脑绑定域名访问,计算机绑定域名访问

  我们知晓localhost绑定的是本地主机IP(127.0.0.1),那么大家能否够自定义绑定当地主机IP地址呢?答案是必定的,同修改hosts文件,我们可以落成地点的需要。

  打开当地C盘,找到Windows文件夹–>System32文本夹–>drivers文件夹–>etc文件下的hosts文件,使用管理员身份打开,然后您就知晓了。

# 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
    127.0.0.1       m.hpugs.com

  青色部分即为我设置的绑定当地IP的域名(域名可以轻易安装)

我们知晓localhost绑定的是当地主机IP(127.0.0.1),那么大家能不可能自定义绑定当地主机IP地…

  大家了然localhost绑定的是地方主机IP(127.0.0.1),那么大家能不可能自定义绑定当地主机IP地址呢?答案是毫无疑问的,同修改hosts文件,我们得以兑现地点的急需。

  打开当地C盘,找到Windows文件夹–>System32文件夹–>drivers文件夹–>etc文件下的hosts文件,使用管理员身份打开,然后您就明白了。

澳门金沙国际,  打开当地C盘,找到Windows文件夹–>System32文书夹–>drivers文件夹–>etc文件下的hosts文件,使用管理员身份打开,然后你就通晓了。

# 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
    127.0.0.1       m.hpugs.com
# 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
    127.0.0.1       m.hpugs.com

电脑绑定域名访问,顺遂登录。 

  青色部分即为我设置的绑定当地IP的域名(域名可以随心所欲安装)

  青色部分即为我设置的绑定当地IP的域名(域名可以肆意安装)

修改hosts文件:

  1. hosts文件的地方:xp,2000等系统在
    C:\windows\system32\drivers\etc
    文件夹中找到Hosts文件并用记事本打开(Windows
    9x/Me系统在C:\Windows文件夹中找)

  2. 根据 ip地址  域名 的格式添加单独的一行记录。例如
    72.14.219.190 www.hbcms.net
    注意,IP地址前面不要有空格,ip地址和域名之间,要有最少1个空格。
    修改后,一定要记得保存文件。

  3. 哪些明白域名的IP地址早就生效?

    1. 在您的微处理器上请按如下步骤操作:开首–>运行–>输入cmd–>ping
      域名–>回车查看结果

    2. 显示结果类似 Reply from 220.181.31.183: bytes=32 time=79ms
      TTL=53
      中档的  220.181.31.183 就是域名的IP地址

  4. 关闭所有的浏览器,重新打开,测试你刚才添加的域名是还是不是能健康访问

  5. 一经访问不正规,请按照3步骤,检查你刚刚设置的域名是或不是对应了不利的IP地址

加入上面的:

#Google Plus
2a00:1450:8007::64 plus.google.com
2404:6800:8005::62 talkgadget.google.com

#由于IPV6目前还不普及,于是补上修改hosts文件的相应IP地址:

#google plus
74.125.230.107 plus.google.com
209.85.175.132 images1-focus-opensocial.googleusercontent.com
209.85.175.132 images2-focus-opensocia2.googleusercontent.com
209.85.175.132 s2.googleusercontent.com
209.85.143.132 lh1.googleusercontent.com
209.85.175.132 lh1.googleusercontent.com
209.85.143.132 lh2.googleusercontent.com
209.85.175.132 lh2.googleusercontent.com
209.85.143.132 lh3.googleusercontent.com
209.85.175.132 lh3.googleusercontent.com
209.85.175.132 lh4.googleusercontent.com
209.85.143.132 lh4.googleusercontent.com
209.85.143.132 lh5.googleusercontent.com
209.85.175.132 lh5.googleusercontent.com
209.85.143.132 lh6.googleusercontent.com
209.85.175.132 lh6.googleusercontent.com

相关文章