Dns.Resolve : Dns « System.Net « VB.Net by API






Dns.Resolve

  

Imports System.Net
Imports System.Net.Sockets


Public Class Tester
    Public Shared Sub Main


        Try
            Dim myIPHostEntry As IPHostEntry = Dns.Resolve("www.google.com")
            Dim myIPAddresses() As IPAddress = myIPHostEntry.AddressList
            Dim myIPAddress As IPAddress

            Dim strIPAddressList As String

            For Each myIPAddress In myIPAddresses

                Console.WriteLine(myIPAddress.ToString)

            Next
        Catch ex As SocketException
            Console.WriteLine(ex.Message)
        End Try

    End Sub
End Class

   
    
  








Related examples in the same category

1.Dns.BeginResolve
2.Dns.GetHostByAddress
3.Dns.GetHostByName
4.Dns.GetHostName()