IIS - can't access page by ip address instead of localhost
Solution 1
So I had this same problem with WSUS and it turned out that IIS 8.5 was not binding to my ipv4 ip address, but was binding to ipv6 address. when I accessed it via localhost:8580 it would translate it to the ipv6 localhost address, and thus would work. Accessing it via ip was a no go. I had to manually bind the address using netsh, then it worked right away. bloody annoying.
Steps:
- Open command prompt as administrator
- Type the following:
netsh http add iplisten ipaddress (IPADDRESSOFYOURSERVER)
that's it. You should get:
IP address successfully added
I found the commands here https://serverfault.com/questions/123796/get-iis-7-5-to-listen-on-ipv6
Solution 2
Maybe it helps someone too:)
I'm not allowed to post images, so here goes extra link to my blog. Sorry.
IIS webpage by using IP address
In IIS Management : Choose Site, then Bindings.
Add
- Type : http
- HostName : Empty
- Port : 80
- IP Address : Choose from drop-down menu the IP you need (usually there is only one IP)
Solution 3
The IIS is a multi web site server. The way is distinct the site is by the host header name. So you need to setup that on your web site.
Here is the steps that you need to follow:
How to configure multiple IIS websites to access using host headers?
In general, open your web site properties, locate the Ip Address and near its there is the advanced, "multiple identities for this web site". There you need ether to add all income to this site with a star: "*", ether place the names you like to work with.
Solution 4
In my case it was because I was using a port other than the default port 80. I was able to access the site locally using localhost but not on another machine using the IP address.
To solve the issue I had to add a firewall inbound rule to allow the port.
Solution 5
Check the settings of the browser proxy . For me it helped , traffic was directed outside.
KlimczakM
Full Stack Mobile Developer eager to learn new things. #iOS #Swift #Android #Kotlin
Updated on July 09, 2022Comments
-
KlimczakM almost 2 years
I'm trying to publishClickOnce
application and test it locally. I want to provide installation link so I need to update location with an IP address otherwise I won't be able to install it (becauselocalhost
is translated into computer name and it's not accessible). The problem is, that on myIIS
I can access my page only by usinglocalhost
in the address.http://localhost:9995/publish/Publish.htm <-- working http://192.168.1.104:9995/publish/Publish.htm <-- not working (my IP address) http://my_pc_name:9995/publish/Publish.htm <-- not working http://127.0.0.1:9995/publish/Publish.htm <-- even that is not working
I'm using
Windows 7
andVisual Studio 2012
withIIS Express 8.0
, but I tried the same onVisual Studio 2010
and it'sASP.NET server
and still failed. I have my firewall turned off.Do you have any ideas what can be wrong?
-
SaidbakR over 8 yearsThe correct command syntax
netsh http add iplisten xxx.xxx.x.x
Checkout this resource -
Sruit A.Suk almost 7 yearsIt take me 2 hours to figure out this... thanks alot
-
miradham over 6 yearsfor windows 10 following format worked for me
netsh http add iplisten=xxx.xxx.x.x
-
Talha Imam over 5 yearsFor Windows Server 2012, you can enter * for both HostName and IP Address.
-
Richard Vanbergen almost 5 yearsLogged in just to thank you and CURSE MICROSOFT TO HADES FOR NOT MAKING THE LOOPBACK ADDRESS ON BY DEFAULT! AGH!
-
devRyan over 4 yearsI believe that for that question asked, this is the most appropriate answer.
-
SPnL over 4 yearsShowing only one IP address but can I use my custom IP address?
-
Black over 4 yearsAfter following this tip, when I try to start IIS Express via my IDE, I get an error message "Unable to connect to web server 'IIS Express'"
-
Gojira over 4 yearsThis was my problem. Even though I was using the only IP address the machine had, for some reason using both IP and host broke it. Entering a wildcard IP fixed it.
-
Frédéric Fect about 4 yearsnetsh http add iplisten ipaddress=IPADDRESSOFYOURSERVER worked for me! Thanks
-
datchung almost 4 yearsFor Windows Server 2016, this command worked for me
netsh http add iplisten ipaddress=x.x.x.x
-
maddy over 3 yearsThis fixed my issue.
-
VPetrovic over 2 yearsThank you very much. This was the solution for my case where server needed to be accessed in local intranet. I had bindings for "localhost" as hostname, that was causing the problem. I changed it to empty hostname and specific local ipv4 address of server as you stated.