您的位置:首页 > 其它

在自己的主机上配置域名

2017-04-06 15:54 162 查看
项目开发调试过程中,我们对工程进行访问时,一般都是采用在地址栏直接输入本机的IP地址,曾经想过要是也能像访问http://www.chinaunix.net/ 一样那就爽了,后来同事告诉我,其实是很简单!
现将设置方式介绍如下:

进入C盘如下目录:
C:\WINDOWS\system32\drivers\etc
 
找到文件:hosts
 
用写字板打开该文件
 
此时你会看到以下内容:

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   

    

***********************************************************************  

 
接下来该怎么办,不用说了吧 ^ ^ !哈哈哈哈,竟然这么简单................
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: