#1
  1. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    6
    Rep Power
    0

    Website works with localhost but not with IP or hostname


    I'm running IIS 5.1 under winxp and I'm having the following problem.When I access my website with http://localhost it works fine, but when I try http://<hostname> or http://<ip address> I get 'Cannot find server or DNS Error'. I've tried disabling the firewall and it makes no difference. Any advice would be greatly appreciated.

    Thanks,
    Steve
  2. #2
  3. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    1
    Rep Power
    0
    sigh.. i am having exactly the same problem like you..
    is there any one can help us??

    thank you

    regars,

    yingjie
  4. #3
  5. Alter Ego Wizard
    ASP Genius (4000 - 4499 posts)

    Join Date
    Jun 2004
    Location
    Edinburg Tx
    Posts
    4,401
    Rep Power
    1657
    Have you tried adding the <hostname> to the file hosts under the windows/system32 folder?
  6. #4
  7. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    Do you have a router? If so, have you enabled port forwarding for http through your router? Are you sure you have checked every firewall including the XP firewall?

    Open a command prompt and try ping <ip>. Do you get replies?
    ======
    Doug G
    ======
    I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain
  8. #5
  9. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    6
    Rep Power
    0
    > Do you have a router?
    Yes, I do

    > If so, have you enabled port forwarding for http through your router?
    I'm not sure exactly what you mean. The router allows http traffic through to the LAN, as websites on other machines on the LAN work fine. My machine has a unique IP, not a local IP, so there's no need to forward the router's http port to my IP, right? The website is not available when I use http://<ip address> even on the local machine. Are the router settings relevant in this case?

    > Are you sure you have checked every firewall including the XP firewall?
    Yes

    > Open a command prompt and try ping <ip>. Do you get replies?[/QUOTE]
    Yes, I can succesfully ping my machine using either its IP or hostname

    Thanks,
    Steve
  10. #6
  11. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    Maybe I'm jumping to conclusions. Are you trying to get to a web page served up by IIS on your own computer?
  12. #7
  13. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    6
    Rep Power
    0
    > Are you trying to get to a web page served up by IIS on your own computer?
    correct
    it works when i use http://localhost
    but not when i use http://<ip address> or http://<hostname>
    i've checked ipconfig to make sure that i'm using the correct ip and hostname and the machine can successfully ping itself

    thanks,
    steve
  14. #8
  15. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    If you're on the one computer with IIS running, you should be able to open a web browser to

    http://localhost
    http://<the local ip>
    http://<the computername>

    And get the same results in the browser.

    You didn't make any changes to the IIS default configuration, like changing your default website from all unassigned IP's to a single IP?
  16. #9
  17. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    6
    Rep Power
    0
    >If you're on the one computer with IIS running, you should be able to open a web browser to
    > http://localhost
    > http://<the local ip>
    > http://<the computername>
    > And get the same results in the browser.
    by <the local ip>, do you mean the ip for 'loalhost' (ie 127.0.0.1) or the global ip for the local machine?

    > You didn't make any changes to the IIS default configuration, like changing your default website from all unassigned IP's to a single IP?
    With the website ip set to 'all unassigned ips' :
    http://localhost works
    http://127.0.0.1 works
    http://<global ip of local machine> fails
    http://<the computername> fails

    With the website ip set to <global ip>, nothing works

    Any ideas ?!

    Thanks again,
    Steve
  18. #10
  19. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    Local IP is the IP given to your network interface card. ipconfig will tell you the IP. On a local LAN behind a router on DSL it might be something like 192.168.0.100

    My computer, for example, is on a network off my dsl router, and the ip is 192.168.0.47. If i open IE on this compter, which is running IIS5.1, and enter http://localhost or http://192.168.0.47 or http://127.0.0.1 I get identical results back from IIS, the IIS documentation in my case.

    My MS computer name is VELOCIRAPTOR and if I enter http://velociraptor I also get the same results.

    If you are using an external IP address and you're behind a router, many routers will block access to the outside IP from within the LAN. If you're using a url as the computername, like mycomputer.mydomain.com that is not the same as the MS computername.
  20. #11
  21. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jan 2005
    Posts
    6
    Rep Power
    0
    >If you are using an external IP address and you're behind a router, many routers will block access to the outside IP from within the LAN. If you're using a url as the computername, like mycomputer.mydomain.com that is not the same as the MS computername.

    I am using an external ip address, so your advice about the router might be the problem - i'll look into it.

    But irrespective of this, when i try http://<ms computername> i get the same error.
    However, when i ping <ms computername>, the ip used is my external ip, so perhaps my web browser is also trying to use this ip address?
    Is there a way to confirm that i have the correct <ms computername>?

    thanks,
    steve
  22. #12
  23. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    You can check your computer name from Control Panel - System, or open the properties of My Computer. Look at the computer name tab.

    when I ping my computername ping shows my LAN ip, not my external IP to the rest of the world.
  24. #13
  25. No Profile Picture
    Registered User
    ASP Explorer (0 - 99 posts)

    Join Date
    Jul 2005
    Posts
    1
    Rep Power
    0

    iis prob


    Same prob is with me ..

    I can view my local server on only self Pc ..
    but on the lan i am unable to see server on other node on the browser.
    all the network is running on the lan.
    Anshu/.
  26. #14
  27. No Profile Picture
    Grumpier Old Moderator
    ASP Mastermind (5000+ posts)

    Join Date
    Sep 2003
    Posts
    10,143
    Rep Power
    186
    Did you read anything above? Most likely you have a firewall blocking http.

Similar Threads

  1. Localhost works but IP or Name does not
    By vac2004 in forum Microsoft IIS
    Replies: 7
    Last Post: December 31st, 2008, 04:41 AM
  2. Making IIS work- Need some help
    By samfreak8 in forum Microsoft IIS
    Replies: 4
    Last Post: January 7th, 2005, 08:30 PM
  3. Replies: 0
    Last Post: January 1st, 2005, 01:51 PM
  4. Mass email problem: Text is Looping!
    By niclipse in forum Microsoft SQL Server
    Replies: 1
    Last Post: November 4th, 2004, 04:37 PM
  5. Problem updating access database through localhost website
    By angieng67 in forum Microsoft Access Help
    Replies: 1
    Last Post: October 8th, 2003, 05:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo