IPAddress[] ip= Dns.GetHostAddresses(Dns.GetHostName()); foreach (var item in ip) { if (item.AddressFamily.Equals(AddressFamily.InterNetwork)) { Console.WriteLine(item.ToString()); } } Console.ReadKey();