Search code examples
asp.net-mvciiswebserverweb-hostingiis-express

Hosting own website on iis from home Win10 computer with domain mapping


I have a developed a web application based on asp.net mvc 4 framework and it works fine in visual studio. since we want to launch our website to public we bought a domain from the godaddy account. And in GoDaddy -> Domains -> Manage -> we mapped the domain name to public/external IP address e.g. 178.112.24.5 ( which is different from what i get in cmd-> ipcoonfig-> shows 192.168.0.2). I guess i should use the public ip addresss not the local ip address shown in the cmd -> ipconfig.

Now i created a web site under iis-> sites-> add new site -> mynewdomain -> with protocol as http, ipaddress as unassigned(default) , port as 80 and hostname as www.mynewdomain.com . But whenever i launch this site from iis, it routes to ISP router configuration login.html page(BTW i use Rogers Internet). So it also fails to launch from other network computers and chrome shows the error as ERR_CONNECTION_REFUSED.

I followed some posts on this site: How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

https://serverfault.com/questions/54623/sites-in-iis-not-available-externally

I tried to fix this by defining firewall rule for port 80 (selected domain,private and public ) , dnsflush and some suggestions from the above two links. But it didn't fix the issue.


Solution

  • You want host your app yourself, ok. So: 1. To access your host from other networks you've open ports (80 for http and ) in your firewall, sure your local IP address will 192.168.0.2 and you can access your app from LAN on it. But others must get your external IP. 2. Next moment is your domain resolver, you must setup your Name Servers for your host external IP address. Now what can you do: First of all use DMZ for testing, it will be open all connections to your machine, but after testing setup your firewall and open only nessessary ports. And if your internet provider gives you your external IP + not blocking connections you can host your application. Sure this way of host your web site is not recommended because: A. Windows 10 Home is not server OS. B. You need minimum 100 MB/s Speed. C. Not secured to use home router as firewall. Hope this will help you.