Step-by-Step: Running your webserver on a different port number using host headers
August 20, 2001

If you are running webserver software that DOES NOT ALLOW virtual hosting, "ip-less" domain names, or host headers, please use this article instead: Running your webserver on a different port number. (Windows NT Workstation, Windows 2000 Professional)

Let's get down to it.  Most web requests come across on port 80 for http.  However, due to the Code Red virus, many ISP's are now blocking port 80 which is where the virus scans.  By blocking port 80, the virus activity is slowed, but all webservers are also blocked.  This article explains how to run your webserver on a different port other than port 80. 

The nice thing about out solution is that since Code Red targets port 80, we are not aiding the virus with this work around.  Unless your server is infected that is.  Then again, if your server is infected, your computer will still be attacking other computers, with or without this work around.

If your ISP does not allow you to run servers, we do not advise you to use this information to get around it.  The only reason we're publishing this material is because some ISP's are blocking port 80 due to the virus and not because of home webservers.  Like anything else in this world, YOU are responsible for your actions.  DSL/Cable Webserver and affiliated parties are not responsible if you get busted by your ISP.  Use your judgment whether you should or should not use this information.  I trust you are smart enough to decide.

This article is not very heavy on the specifics because many of you have different types of setups and it would be useless to get into the details.  What you should get from this article are the concepts.  The concepts can be applied across all different types of setups.

In order to run a webserver on a different port number, you will have to change several things in your setup.  This article assumes a few things.

  1. Your DNS is handled by
  2. You are using webserver software that allows you to change the port number of the web service.
  3. You are using webserver software that allows you to run virtual hosting, "ip-less" domain names, or host headers.
  4. There are probably many more assumptions, but I can't think of them right now.  I'll add it as I go along.  Hehehe.
1.  Make changes to your DNS servers.

The work around I came up with includes using for your DNS.  Under "IP Addresses", delete the entry for "". Next, delete the entry for "" (without the www). Now, add an entry for "".  The "www2" can be anything you want, but you must keep it consistent throughout this process.

Create an entry under "WebForwards" that forwards "" to "". Also create an entry that forwards "" to "". This basically forwards both "" and "" to " port 8000".  Port 8000 can actually be any number you want.  However, this number must be consistent through this whole process including the firewall/router and webserver software.  As you configure "WebForwards" make sure the "Cloaked" box is checked.  This way, visitors won't see the port number in the address bar.

The way this little trick works is that "" is attached to your IP number.  Then we attach "" and "" onto "".  So in the end, it works out that "" and "" equals "your IP number + port 8000".

You might ask why don't we just attach "" or "" onto "your IP number + port 8000".  Well, it turns out that doesn't allow you to do this.  I know.  I tried.

Another question you might have is what happens to "".  Well, since it is attached to your IP number it will get to your IP number, but since it defaults to port 80, the request will be blocked by your ISP (if your ISP has decided to block port 80, that is).  Bottom line is both "" and "" will work while "" will be blocked.

Now we have to make changes to the mail servers in order to receive email.  Delete the current entry under "Mail Servers".  Add an entry for mail directed to "" to be sent to "".

After you make your changes, you have to wait a while for the changes to percolate across the Internet.

Here is a screenshot of my setup for  You're should look similar.

2. Setup port forwarding in your router to forward port 8000 to your server.

If you forgot how to setup port forwarding, here's a refresher: Port Forwarding on the Linksys Cable/DSL Router

Mine looks like this:

3. In your server configuration, setup your website to run on port 8000 and use host headers for "www2".
Click on Advanced and delete the entries for "" and "".  Add an entry to use "" as host headers.  Change the port number to port 8000.

This is what my IIS 5.0 Advanced Server screen looks like once the changes are done.

You're done. It's all good now.. sort of.  It's not as good as running on port 80, but hey, it's better than not running at all right? 

Have fun.


Step by Step Menu