Verify IP Address

Verify if IP address resolves to a host name.

        Dim ip() As IPAddress = System.Net.Dns.GetHostAddresses("www.microsoft.com")

        If ip.Count > 0 Then
            For Each ipadd As IPAddress In ip
                MsgBox(ipadd.ToString)
            Next
        End If
Advertisements

Get website ip address

        Dim ip() As IPAddress = System.Net.Dns.GetHostAddresses("www.microsoft.com")

        If ip.Count > 0 Then
            For Each ipadd As IPAddress In ip
                MsgBox(ipadd.ToString)
            Next
        End If