Mega Code Archive

 
Categories / C# Book / 08 Net
 

0602 From IP address to domain name

The GetHostEntry method goes the other way around, converting from address to domain name: using System; using System.Net; using System.Threading; using System.IO; using System.Text; class ThreadTest { static void Main() { IPHostEntry entry = Dns.GetHostEntry("199.181.132.250"); Console.WriteLine(entry.HostName); } } The output: tienda.espndeportes.com