DNS Get Host By Name : DNS : Network C# Source Code


Custom Search

C# Source Code » Network » DNS »

 

DNS Get Host By Name









    

using System;
using System.Net;

public class DNSName
{
   public static void Main()
   {
    string hostName = Dns.GetHostName();
    Console.WriteLine("Local hostname: {0}", hostName);
    IPHostEntry myself = Dns.GetHostByName(hostName);
    foreach (IPAddress address in myself.AddressList)
    {
       Console.WriteLine("IP Address: {0}", address.ToString());
    }
   }
}
           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Network
» DNS