How To Host An ASP.NET Website From Your Computer

Yesterday i had to host an ASP.NET website on my computer. What i did to host an ASP.NET website from my computer is written below in detail.

Things you need to host an ASP.NET website from your computer:

  1. Web-server installed on your machine. Running on some valid port (80 is recommended).
  2. Firewall Exception to allow HTTP connections.
  3. A URL pointing to your system.
  4. A DNS service to point a URL to your system. A dynamic IP is not a problem 🙂

Procedure to host an ASP.NET website from your computer:

1. Install Internet Information System (IIS 7.5) on Your computer to host an ASP.NET website. You can follow the tutorial to install Internet Information system on your computer. What i did is, i checked all the features relevant to IIS to install them.

2. Add Firewall Exception to allow HTTP requests. Make sure both World Wide Web Services (HTTP) and Web Management Service (HTTP) are added in exception list. See the following Image:

3. Get a URL pointing to your computer. To do this you need a DNS service. I used a free DNS service freedns.

  1. Make an account.
  2. If you have a dynamic IP, then click on Dynamic DNS from main menu.
  3. Click Dynamic DNS Clients to download FreeDNS update Windows client, here is the direct link, and install it.
  4. Register a domain or sub-domain. I had to test my application so i just registered a sub-domain.
  5. Click on Subdomains and add a sub-domain. I registered haristest.mooo.com. Where mooo.com is a public domain and this public domain allows any user to register a sub-domain. Destination shows your computer public IP where the sub-domain will be pointing. See following image for details: sub-domain register with a free dns service
  6. Note: Adding domain or sub-domain takes time so it may happen that sub-domain may not work initially. Wait for some time (around 1 hour) and it would be working.
  7. Tip: some times even after waiting your sub-domain may not work. In that case shutdown FreeDNS update application, delete sub-domain and register the sub-domain again.
  8. Run FreeDNS update application and in settings tab provide your credentials and get domain list. This application will update your domain or sub-domain settings whenever your IP address is changed.FreeDNS update application
  9. Test your hosted domain. Goto http://localhost:80/, Goto http://119.154.29.225:80/ and Goto http://haristest.mooo.com:80/ all will show same screen.
  10. Note: If http://localhost:80/ doesn’t show page written “IIS7” like in above image, then your IIS server is not working properly you may need a restart to make it functional.
4. Host your website, now you can host any website on your computer with IIS. Like i hosted my test website on it.

Note: Hosting a website on your system is not secure by default.

You can ask questions and write suggestions to improve this post in your comments.

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook