Dns.GetHostByName : Dns « System.Net « C# / C Sharp by API






Dns.GetHostByName

  

using System;
using System.Net;

class MainClass
{
    public static void Main()
    {
        IPHostEntry ihe = Dns.GetHostByName(Dns.GetHostName());
      IPAddress myself = ihe.AddressList[0];

        Console.WriteLine(myself);
    }
}

   
    
  








Related examples in the same category

1.Dns.EndResolve(IAsyncResult ar)
2.Dns.GetHostByAddress(IPAddress ip)
3.Dns.GetHostEntry(String value)
4.Dns.GetHostName()
5.Dns.Resolve