Dim strHostName As String = Dns.GetHostName ().
'Use GetHostName with no parameter to return the host name of a local machine.
'Once you have host name, pass this host name as a parameter in GetHostByName
Dim ipEntry As IPHostEntry = Dns.GetHostByName(strHostName)
Dim IpAddr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
Do While i < IpAddr.Length
Console.WriteLine ("IP Address {0}: {1} ", i, IpAddr(i).ToString ())
i += 1
Loop