using System; using System.Net; using System.Net.Sockets; using Lavantech.Dns; class TestApp { public static void Main() { try { // Setup timeout to 10 seconds SimpleDNSLookup.Timeout = 10000; // Address lookup IPAddress addr = SimpleDNSLookup.GetIPAddress("www.hotmail.com"); Console.WriteLine("GetIPAddress = "+addr); // Reverse lookup (Hostname from address) string hostName = SimpleDNSLookup.GetHostName(addr); Console.WriteLine("GetHostName = "+hostName); // Mail Exchange Lookup string mx = SimpleDNSLookup.GetMailExchange("hotmail.com"); Console.WriteLine("GetMailExchange = "+mx); // Aliase Name lookup string cname = SimpleDNSLookup.GetCanonicalName("www.cnn.com"); Console.WriteLine("GetCanonicalName = "+cname); // Name Server Lookup string ns = SimpleDNSLookup.GetNameServerForDomain("hotmail.com"); Console.WriteLine("GetNameServer = "+ns); // Domain Admin Email Lookup string adminMB = SimpleDNSLookup.GetDomainAdminMailBox("hotmail.com"); Console.WriteLine("GetDomainAdminMailBox = "+adminMB); // IPv6 Address lookup string ipv6 = SimpleDNSLookup.GetIPV6AddressString("ipv6.bt.com"); Console.WriteLine("GetIPV6Address = "+ipv6); // Text information lookup string txt = SimpleDNSLookup.GetTextInformation("hotmail.com"); Console.WriteLine("GetTextInformation = "+txt); } catch(Exception exp) { Console.WriteLine(exp.Message); Console.WriteLine(exp.StackTrace); } Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Press Enter to Exit the Program."); Console.ReadLine(); } }