Get IPs for a host name
5
Returns a string collection of IP addresses for a passed in domain name.
'get ip addresses for a given domain name, example domainName = www.google.com
Private Function GetAllIPAddresses(ByVal domainName As String) _
As System.Collections.Specialized.StringCollection
Dim results As New System.Collections.Specialized.StringCollection
Dim hostInfo As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(domainName)
For Each ip As System.Net.IPAddress In hostInfo.AddressList
results.Add(ip.ToString)
Next
Return results
End Function






There are currently no comments for this snippet.