Results 1 to 10 of 10

Thread: Why cant I access my website from my LAN

  1. #1
    Junior Member
    Join Date
    May 2004
    Posts
    6

    Why cant I access my website from my LAN

    First of all I have router with NAT capability and a web server running on one of my machines within the lan.

    I do not have a DNS server....I'm using a free public DNS server.

    When I type in the web url of my website (www.mywebsite.com) from within the lan, all I see is title of the web page on the top of IE explorer and the error: "Action canceled
    Internet Explorer was unable to link to the Web page you requested. The page might be temporarily unavailable."

    When I type in the private lan ip address of the machine that runs the web server (192.168.0.100) the website comes up fine.

    Also, I can access the website from the "outside" (ie, work) by simply typing in the web url so my webserver is fine.

    Does this have anything to do with my ISP's router not allowing packets to loopback?

    Any help appreciated!

  2. #2
    Banned
    Join Date
    Jul 2001
    Posts
    1,100
    Greetings:

    Easy. You're typing in your domain, an external DNS server is resolving it to your external IP. Mean while, you're on your lan, which is all configured with your internal addressing because of NAT.

    Many routers/firewalls will recognize the request as being for an external IP that's part of your network, and do the NAT translation for it as well. Some of the routers/firewalls that we see in the home user market do not.

    Simple solution? Add the domain to your hosts file on the machines on your lan. For windows (which I assume you're using), go to:

    c:\windows\system32\drivers\etc\hosts

    add the following line:

    192.168.0.100 www.mywebsite.com

    save the file, and you'll be in a happy place.

    Hope that helps!

  3. #3
    AO Antique pwaring's Avatar
    Join Date
    Aug 2001
    Posts
    1,409
    I imagine your name servers resolve your web site URL to the external IP address of your router, which probably forwards port 80 to the machine on your network that is running the web server. If this is the case, you will be unable to access your site using the URL because you must use the internal IP address (hence why using 192.168.0.100 works but www.mywebsite.com doesn't). I have the exact same problem on my network and as far as I am aware there is nothing you can do about it other than getting an extra static IP and assigning it to the server machine.

    Edit: Looks like JP beat me to it.

    BTW, the hosts file suggestion will work, but you'll get problems if you want to use it on more than one machine on your network, because you'll have to keep them all in sync. It's a throwback to the days when hosts really were controlled by one file that was updated regularly.
    Paul Waring - Web site design and development.

  4. #4
    Junior Member
    Join Date
    May 2004
    Posts
    6
    JP,

    doesnt' seem to work. I even tried typing in:

    192.168.0.100:8181 www.mywebsite.com

    since i had to change my port number because my isp blocks port 80.

    any more suggestions?

  5. #5
    Senior Member
    Join Date
    Oct 2002
    Posts
    4,055
    because my isp blocks port 80.
    Call me stupid, but couldn't that be it?
    Space For Rent.. =]

  6. #6
    Senior Member
    Join Date
    Oct 2002
    Posts
    4,055
    Also, if your ISP is blocking port 80 and the DNS service is resolving to your IP address xx.xx.xx.xx:80 then that won't work. You'll need to use a port redirecting service.
    That's what I had in mind, but didn't know if the DNS service was resolving to his IP. It wouldn't be able to connect and the website wouldn't work if that port is blocked.
    Space For Rent.. =]

  7. #7
    Macht Nicht Aus moxnix's Avatar
    Join Date
    May 2002
    Location
    Huson Mt.
    Posts
    1,752
    Sorry, this might be a silly question but:
    192.168.0.100:8181 www.mywebsite.com
    You did use the name of your website and not mywebsite.com didn't you? (I would hope you have used www.mywebsite.com as a sanitized version of your real website, and that you made this change with the real website)
    Told you this was a silly question, but I have had people take some advice a little to literally, and now I just like to check such things.
    \"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, Champagne in one hand - strawberries in the other, body thoroughly used up, totally worn out and screaming WOO HOO - What a Ride!\"
    Author Unknown

  8. #8
    Junior Member cybersamurai's Avatar
    Join Date
    Apr 2004
    Location
    At tha beach!
    Posts
    25
    i've got a similar problem, could spyder elabo on port directing services????
    see the sarcasim in my smile ????

  9. #9
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Originally posted here by jim29
    192.168.0.100:8181 www.mywebsite.com
    Remove the :8181. It shouldn't be in your hosts file.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  10. #10
    Custom User
    Join Date
    Oct 2001
    Posts
    503
    As SirDice was saying, the port number shouldn't be in the hosts file. This is because the hosts file acts like an internal DNS list. When you type in an address, as far as I am aware, the computer will check this file first to try and resolve and address.

    DNS simply resolves a domain name like www.mywebsite.com as you were using in your example above and doesn't care about port numbers. This means that if you want to run other servers on your computer that's acting as a webserver, to access it from your other computer, you don't need to do anything because you've already added the server to your hosts file.

    It's the same way that you don't have to register a domain name for every port you use with it, you just need to register the name and specify what ip address it is attached to.

    ac

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •