3

I have deployed an application on the IIS server, as per my requirement i need to get IP-Address of hosted machine which is on the network and i have just host-name of the machine using c# e.g

http://abc

Where abc is deployed on IIS which can be any where on the network i don't know. Is it possible to get IP-Address using this host-name with c#

user1387147
  • 945
  • 4
  • 17
  • 32

1 Answers1

3

Include

using System.Net;

and use

string url = "www.howtogeek.com";
IPAddress[] addresslist = Dns.GetHostAddresses(url);

The following answer also might be helpfule

How to get my own IP address in C#?

Community
  • 1
  • 1
Asif Mushtaq
  • 13,010
  • 3
  • 33
  • 42
  • this s not live ipAddress it is on domain network please look at my example http://192.168.3.183/ApplicationName where 192.168.3.183 is unknown – user1387147 Jun 19 '12 at 08:01