---
title: "给本地系统加域名"
author: "radio123"
date: "2011-09-26T16:36:56Z"
tags: []
categories: ["操作系统"]
slug: "untitled"
draft: false
lastmod: "2012-04-13T16:00:16Z"
id: 1180784
url: "https://radio123.iteye.com/blog/1180784"
---

总所周知，使用tomcat开发，访问本机系统时，可以使用 [http://localhost:8080](http://localhost:8080) 或者 [http://127.0.0.1:8080](http://127.0.0.1:8080) 访问，如果想给自己本机的应用加一个假的域名呢，可以找到系统文件 C:\\WINDOWS\\system32\\drivers\\etc\\hosts，打开hosts 文件，在 后面添加 想加的域名即可，比如 iwant.com , 下次访问的时候你就可以输入 [http://iwant.com:8080](http://iwant.com:8080) 访问你应用了

![](http://dl.iteye.com/upload/attachment/0056/0527/f05de58d-3e05-39fa-8f49-4314954d0cdc.jpg)