Dns.Resolve resolves a DNS host name or IP address to an IPHostEntry instance. : Dns « Network Remote « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Network Remote » DnsScreenshots 
Dns.Resolve resolves a DNS host name or IP address to an IPHostEntry instance.
 
Imports System.IO
Imports System.Net
Imports System.Text

public class MainClass
   Shared Sub Main()
        Try
            Dim hostInfo As IPHostEntry = Dns.Resolve("google.com")
            Dim address As IPAddress() = hostInfo.AddressList
            Dim [aliasAs [String]() = hostInfo.Aliases
        
            Console.WriteLine(hostInfo.HostName)
            Dim index As Integer
            For index = To [alias].Length - 1
                Console.WriteLine([alias](index))
            Next index
            For index = To address.Length - 1
                Console.WriteLine(address(index))
            Next index
        Catch As Exception
            Console.WriteLine("Exception caught!!!")
            Console.WriteLine(("Source : " + e.Source))
            Console.WriteLine(("Message : " + e.Message))
        End Try
   End Sub
End Class
        

   
  
Related examples in the same category
1.Uri.Authority Property gets the Domain Name System (DNS) host name or IP address and the port number for a server.
2.Uri.CheckHostName Method tells whether the specified host name is a valid DNS name.
3.Uri.DnsSafeHost Property gets an unescaped host name that is safe to use for DNS resolution.
4.Dns Class provides simple domain name resolution functionality.
5.Dns.GetHostByAddress creates an IPHostEntry instance from the specified IPAddress.
6.Dns.GetHostByName gets the DNS information for the specified DNS host name.
7.Dns.GetHostEntry resolves a host name or IP address to an IPHostEntry instance.
8.Dns.GetHostName gets the host name of the local computer.
w__w___w__._j__a_v__a_2___s___._c__om__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.