To read the article online, visit http://www.4GuysFromRolla.com/webtech/080200-1.shtml

Using One I.P Address to Host Multiple Domains

By Rob Black


After reading a recent article by Erick Stover entitled Hosting Multiple Domains on One IP Address, I just had to tell the world (well, people that donít already know) that there is an easier, and probably faster, way to do this.

In the aforementioned article the author explains how to create an ASP page that will check for the domain name requested by the client and automatically send the client the correct page for that site. This will all work just fine but in my opinion it is slow and more difficult to administer than "Host Header Names."

Host Header Names are a feature of Microsoft Internet Information Server (versions 4 and 5, Iím unsure about earlier versions) that allows you to operate multiple domains from one I.P address. As far as I can tell, using IIS to run more than one domain name from a machine with a single I.P address will work in much the same way as the ASP based solution except that the server does all the work for you.

Below is a screenshot of the Host Header Name configuration window as it appears in the Internet Services Manager. (We are using Windows 2000 Advanced Server so the screenshots may differ slightly from your system)

The column on the left is for your I.P address, since I only have one address, and that address is subject to change, I use (All Unassigned), the second column is your Port number and the third all-important column is for your Host header Name. This is the name that people will have typed into their web browser in order to access your site. In the example, the Host Header Name in use is after12.sale.net. This is a test website running over our intranet but the host header names function just the same way. If I type http://after12.sale.net in to my browser, the site comes up, even though my machine has only one I.P address.

If your site is on the Internet, you may use a Host header Name similar to this: www.mysitename.com

Here are a bunch of sites on this machine and their associated host header names:

To access the Host Header Name options, do the following:

  • In the Internet Services Manager, Right click on one of your sites and choose "properties" from the pop-up menu.
  • In the "Website Identification Area" of that page click on the "Advanced" button.
  • Now select your site in the "Multiple Identities For This Website" area of the page and click on the "Edit" button.
  • In the edit window type your chosen Host Header Name into the appropriate box and click OK.
  • Click OK on the other open options windows to close them all and save your new settings.

That's about all there is to it, although in order for you to run this on a single machine you must have some kind of DNS system up and running although you do not need a real (internet registered) domain name.

Happy Programming!


Rob Black
ASP/SQL/.NET Developer


Article Information
Article Title: Using Host Headers to Allow for One I.P Address to Host Multiple Domains
Article Author: Robert Black
Published Date: Wednesday, August 02, 2000
Article URL: http://www.4GuysFromRolla.com/webtech/080200-1.shtml


Copyright 2017 QuinStreet Inc. All Rights Reserved.
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers