DNS Get Host By Name : DNS « Network « C# / C Sharp






DNS Get Host By Name

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());
    }
   }
}
           
         
  








Related examples in the same category

1.DNS Reverse Lookup and Lookup
2.DNS Name Resolution
3.Find DNS Servers
4.Get Resolve Info:DNSGet Resolve Info:DNS
5.Get DNS Host InfoGet DNS Host Info
6.Get DNS Address Info
7.DNS Address ResolverDNS Address Resolver
8.Find DNS Servers from Registry
9.Get Dns Server