Reputation: 955
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#
Upvotes: 3
Views: 1846
Reputation: 13150
Include
using System.Net;
and use
string url = "www.howtogeek.com";
IPAddress[] addresslist = Dns.GetHostAddresses(url);
The following answer also might be helpfule
Upvotes: 3