See Also

Dns Members  | Dart.PowerTCP.EmailValidation Namespace

Requirements

Namespace: Dart.PowerTCP.EmailValidation

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

Assembly: Dart.PowerTCP.EmailValidation (in Dart.PowerTCP.EmailValidation.dll)

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Requirements Languages PowerTCP Email Validation for .NET

Dns Class

Dart.PowerTCP.EmailValidation Namespace : Dns Class (Dart.PowerTCP.EmailValidation)

Provides domain name resolution.

For a list of all members of this type, see Dns members.

Inheritance Hierarchy

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Dart.PowerTCP.EmailValidation.Dns

Syntax

[Visual Basic]
<ToolboxItemAttribute(ToolboxItemType=, ToolboxItemTypeName="")> <DescriptionAttribute("The Dns Component resolves names, addresses, and mail servers.")> Public Class Dns    Inherits Component
[C#]
[ToolboxItemAttribute(ToolboxItemType=, ToolboxItemTypeName="")] [DescriptionAttribute("The Dns Component resolves names, addresses, and mail servers.")] public class Dns : Component
[C++]
[ToolboxItemAttribute(ToolboxItemType=, ToolboxItemTypeName="")] [DescriptionAttribute("The Dns Component resolves names, addresses, and mail servers.")] public __gc class Dns : public Component
[C++/CLI]
[ToolboxItemAttribute(ToolboxItemType=, ToolboxItemTypeName="")] [DescriptionAttribute("The Dns Component resolves names, addresses, and mail servers.")] public ref class Dns : public Component

Remarks

The Domain Name System (DNS) uses servers distributed across the Internet to provide domain name/IP address translation and electronic mail routing information.

The Dns class provides forward lookup (resolve a name to an address), reverse lookup (resolve an address to a name), and MX lookup (resolve an email address to the mail server address responsible for that mail domain). Synchronous and asynchronous use is fully supported.

Example

The following example demonstrates using the Dns control to resolve a domain name.

[Visual Basic] 

Private Sub ResolveTest()
   Dns1.Servers.Add("206.64.128.5") 'Adds this server to list of DNS servers
   Dns1.RotateServers = True 'Will always try next server in Dns1.Servers
   Dns1.Retries = 2 'On failures, try an additional two times
   Dns1.RetryInterval = 0 'Do not wait between retries
   Dim result As System.Net.IPHostEntry = Dns1.GetHost("www.dart.com")
   DisplayResult(result)
End Sub

Private Sub DisplayResult(ByVal result As System.Net.IPHostEntry)
   ' Display host name
   Debug.WriteLine("Host name: " + result.HostName)

   ' Display addresses, if any
   Dim add As System.Net.IPAddress
   For Each add In result.AddressList
      Debug.WriteLine("Address: " + add.ToString())
   Next

   ' Display aliases, if any
   Dim s As String
   For Each s In result.Aliases
      Debug.WriteLine("Aliases: " + s)
   Next
End Sub

[C#] 


private void ResolveTest()
{
  dns1.Servers.Add(
"206.64.128.5"); 'Adds this server to list of DNS servers
  
dns1.RotateServers = true; 'Will always try next server in Dns1.Servers
  
dns1.Retries = 2; 'On failures, try an additional two times
  
dns1.RetryInterval = 0; 'Do not wait between retries
  
System.Net.IPHostEntry result = dns1.GetHost("www.dart.com");
  DisplayResult(result);
}

private void DisplayResult(System.Net.IPHostEntry result)
{
  
// Display host name
  
Debug.WriteLine("Host name: " + result.HostName);

  
// Display addresses, if any
  
foreach(System.Net.IPAddress add in result.AddressList)
     Debug.WriteLine(
"Address: " + add.ToString());

  
// Display aliases, if any
  
foreach(string s in result.Aliases)
     Debug.WriteLine(
"Aliases: " + s);
}
                

Requirements

Namespace: Dart.PowerTCP.EmailValidation

Platforms: Windows 98, Windows NT 4.0, Windows ME, Windows 2000, Windows XP, Windows Server 2003, Windows Vista

Assembly: Dart.PowerTCP.EmailValidation (in Dart.PowerTCP.EmailValidation.dll)

See Also

Dns Members  | Dart.PowerTCP.EmailValidation Namespace

 

Send comments on this topic.

Documentation version 1.0.3.0.

© 2008 Dart Communications.  All rights reserved.