try this
Imports System.Net
Public Shared Function GetAllIP(Optional ByVal args As String() = Nothing) As Collection
Dim strHostName As New String("")
Dim col = New Collection
' Getting Ip address of local machine...
' First get the host name of local machine.
strHostName = Dns.GetHostName()
Console.WriteLine("Local Machine's Host Name: " + strHostName)
' Then using host name, get the IP address list..
Dim ipEntry As IPHostEntry = Dns.GetHostEntry(strHostName)
Dim addr As IPAddress() = ipEntry.AddressList
Dim i As Integer = 0
While i < addr.Length
col.Add(addr(i).ToString())
Console.WriteLine("IP Address {0}: {1} ", i, addr(i).ToString())
i += 1
End While
Return col
End Function