How to find out the IP address of IIS to access my site

I deployed a site on my server, how do I know what my server IP address is?

if I know my server ip address, I can access my site from the outside

+3
source share
6 answers

If you know your hostname, you can use nslookupto obtain an IP address. In addition, you can find all ip addresses on network cards using ipconfig. So either:

nslookup hostname

or

ipconfig /all

You can also use netstat -nto find the ip address listening on the port 80(default for http)

+6
source

IIS. - + . "-" "IP-". " ", ipconfig IP-, -.

-, , - [] //WSD .

( ), "ping" "nslookup", , , , URL-, IP-, .

+2

ping . .

ping microsoft.com

, netork, IP- .

0

IP- - IP-, (), , .

, .

, , " ".

0

ping _ / URL- ping

0

.

Request.ServerVariables("LOCAL_ADDR")

String name = "";
name = Dns.GetHostName();
IPHostEntry ipEntry = Dns.GetHostByName(name);
foreach (IPAddress ipaddress in ipEntry.AddressList)
{
    Response.Write("IP : " + ipaddress.ToString());
}
0

Source: https://habr.com/ru/post/1717672/


All Articles