单位的互联网通过联想网御上10M光纤。在局域网内架设了一Web站点,并申请了域名地址。奇怪的是,在公网上访问域名地址没有什么问题,但在单位的局域网上访问域名地址就打不开网站了。记得以前在哪里看到过一篇文章,说增加hosts的IP地址对应域名地址的记录可以快速解析域名。修改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 host
127.0.0.1 localhost
192.168.1.240 XXXX.XXXXXX.com
加入上面红色的那一行,就可实现在内网以域名方式访问内网网站。
当然这只是临时的解决办法,要彻底的解决这个问题,还必须修改网御上的nat配置。详情请见http://wenku.baidu.com/view/fe71d62458fb770bf78a553a.html。
转载于:https://blog.51cto.com/wuhaoshu/432412