using System; using Lavantech.Dns; class TestApp { public static void Main() { // QTYPE_A asks for the ARecord(Address Record). // QCLASS_IN is for Internet class. // null is passed for server name. If null is passed the name server setting DNSLookup dnsLookup = new DNSLookup("www.hotmail.com", DNSLookup.QTYPE_A, DNSLookup.QCLASS_IN, 1000, null); // Get all Answer Records. ResourceRecord[] records = dnsLookup.GetAnswerRecords(); // Print all the Address Records. for(int i=0; i < records.Length; i++) { if(records[i] is ARecord) Console.WriteLine(((ARecord)records[i]).GetIPAddress().ToString()); } Console.WriteLine(""); Console.WriteLine(""); Console.WriteLine("Press Enter to Exit the Program."); Console.ReadLine(); } }