ASP 101 - Active Server Pages 101 - Web05
The Place ASP Developers Go!

Windows Technology Windows Technology
15 Seconds
ASP 101
ASP Wire
VB Forums
VB Wire
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an site
ASP 101 is an site
Internet News
Small Business
Personal Technology

Corporate Info
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash

 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

Use design-time controls
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates

Quick Tips

Name Your Development Sites

Do you ever get sick of trying to remember the IP address to the local development version of a site you're working on? Here's a little trick that might help.

In an ideal world, a developer would be able to work on one site at a time and then once finished, move on to the next project. I'm not sure about you, but that's never really been the case for me. I've usually got half a dozen projects going at a time which means I've usually got six or so IIS Web sites set up on my development server. A few years ago, I finally got sick of keeping track of IP addresses and trying to remember which site was configured where. That's when I started giving each site a name. For example, I access my local copy of ASP 101 via Don't bother trying to get there... the address won't work for you, but it's simple, easy to remember, and just as easy to set up.

The secret is what is called a hosts file. It works like DNS in that it maps names to IP addresses, but unlike DNS it only affects your local machine so you can feel free to name things whatever you want. You can read more about hosts files from Wikipedia, but all you really need to know is that the file is named hosts with no file extension, it's just a plain text file, and it's normally located here: C:\Windows\system32\drivers\etc\. The format is straight-forward. Each entry gets its own line that starts with the IP address and is followed by one or more spaces and the name by which you want to access that IP address. The line for in my hosts file looks like this:

That's it. Simply add the appropriate line, save the file, and you're good to go. Windows picks up the changes automatically.

Once you start naming your sites you can then take things to the next level and pretty much stop worrying about IP addresses at all. If you simply put all your development sites on the same IP address and configure the site's host header value in IIS to match the name you just set up in your hosts file, you can host all you development sites on one IP address and still access them all simultaneously.

Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to:

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback
The Network for Technology Professionals



Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers