home webserver with blah.com domain

1

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?

zeroonea

Posted 2009-11-05T12:42:04.237

Reputation:

Answers

3

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

cagreen

Posted 2009-11-05T12:42:04.237

Reputation:

No so dirty at all, in my opinion! – Arjan – 2009-11-06T11:33:57.650

3

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.

Jason R. Coombs

Posted 2009-11-05T12:42:04.237

Reputation: 1 952

2

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...

Murph

Posted 2009-11-05T12:42:04.237

Reputation: 151

1

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

Keir

Posted 2009-11-05T12:42:04.237

Reputation:

3

If anything, this should read http://localhost:81/

– jhwist – 2009-11-05T12:44:44.450

if the application is configured to a specific domain, this might break its functionality – Ian – 2009-11-05T14:08:09.110

1

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,

http://mydomain:81

will work whereas

mydomain:81

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://.

Jason R. Coombs

Posted 2009-11-05T12:42:04.237

Reputation: 1 952

It will even change localhost into local on many machines. Funny people @Microsoft. – Arjan – 2009-11-06T11:35:53.353

1

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

127.0.0.1    mydomain.com

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

Ian

Posted 2009-11-05T12:42:04.237

Reputation: 196