Advertisement
ivandrofly

DNS - C#

Feb 22nd, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3.  
  4. namespace DNS
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] domains = { "www.google.com", "www.bing.com", "www.subscene.com", "www.facebook.com", "www.legendas.tv"};
  11.             foreach (string domain in domains)
  12.             {
  13.                 Console.WriteLine("DNS: {0}", domain);
  14.  
  15.                 foreach (IPAddress ip in Dns.GetHostAddresses(domain))
  16.                 {
  17.                     Console.WriteLine(ip.ToString());
  18.                 }
  19.                 Console.WriteLine("=========================");
  20.             }
  21.             Console.ReadLine(); // wait here
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement