Tutorial :home webserver with blah.com domain


i did the webserver on my laptop (IIS7, vista), it running on port 81, i'm using dns service of everydns.com to point mydomain.com to my webserver, everything was fine, my friends can access my website throw url http://mydomain.com:81, but i can not (i access website on the same machine which running webserver), web browser always say unable to connect. What happened?


It's possible that your router is denying loopback connections. Since other people can connect to the specified host at port 81, it's possible that when you try to connect, the connection gets translated to the outside on the router then the router refuses to translate it back into the internal network (for your home server).

If this is the case, the suggestions to add to the hosts file would work around this issue, but they're not addressing the core problem.

You might check the advanced network settings (or firewall settings) on your router configuration and make sure loopback connections aren't being blocked.


quick and dirty resolution is to add an entry to your hosts file.


This is almost certainly because your router is getting in the way - your request to your webserver is going to your external IP address and so far as the router is concerned this is odd so needs to be blocked (not sure why, it may be security, it may be something else) but the key point is that from your machine and from within your network the IP address is that of your internal network not that on the public network.

To fix this you need to tell your machine that the IP address for http//mydomain.com is local, two ways to do this: 1) Add an entry to your hosts file 2) If you have a local DNS server (probably unlikely if you're running the server on your laptop) and configure that to point mydomain.com to your laptop's IP address instead of going to retrieve the value from the internet.

If this doesn't cover it we're going to need to know a bit more about the layout of your network.

I'll add that this is, sort of, a developer question as the reason I had to work this out in the first instance was to support some internal dev support stuff that needed to be exposed to external access...


You can probably access your site via http://localhost:81 or


When you're testing locally, are you sure the URL is specified properly? Internet Explorer will give a less-than-useful error if you don't specify the URL properly. Specifically,


will work whereas


Will not. Many users have grown accustomed to entering the domain name without the preceding http:// because normally the browser will add that, but if a port number is specified, IE will not automatically add the http://.


To futher the existing answers:

The vast majority of SOHO routers (so basically anything suppied free with your connection, or you bought for less then ~ £200 / $250) isn't going to cope too well at all with a DNS entry resolving back to their external IP address.

If you just type in http://mydomain.com (i.e. hitting the default port 80), you will probably get your router's homepage. Thus, when you are trying to view on port 81, your requests are trying to come from the router on port 81, which (as you would suspect) has nothing running to serve these requests, so breaks.

Edit your hosts file (c:\Windows\System32\drivers\etc\hosts - you will need to run Notepad as Admistrator if you have UAC enabled), and drop in a new line    mydomain.com  

After you save, flush your dns cache by runing "ipconfig /flushdns" in a command shell

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »