Add Method (DNSServers collection)

Dundas

Add Method (DNSServers collection)

Adds a DNSServer object to the DNSServers collection.

Syntax

DNSServersCollection.Add (Name as string, [TCPIP as long = 1, UDP as long = 3])

The Add method syntax has the following parts:

Part

Description

Name

The name of the DNS server, or its corresponding IP address.

TCPIP

The maximum number of connection attempts using the TCP/IP protocol. Defaults to one (1).

UDP

The maximum number of connection attempts using the UDP protocol. Defaults to three (3).

  Remarks

Use this method to add a DNSServer object to the DNSServers collection. To remove a DNSServer object use the Remove method. To remove all objects from the collection call the Clear method.

To make sure that a DNS server is available to process emails it is recommended that you specify more than one server.

Note that the first server in the collection will be tried first. If it is not available the next DNSServer object will contacted, and so on.

There are two (2) methods of connecting to a DNS server: using the TCP/IP protocol and using the UDP protocol. Different DNS servers may support either protocol or both protocols. By default the TCP/IP method is tried first. If this fails we then attempt to contact the server using UDP. However, if you know what protocols your specified DNS servers use you can optimize the DNS lookup operations by specifying which protocol to use when working with the DNS servers (i.e. set the protocol argument which isn't used by your DNS server to zero).

See Also: DNSServers Collection | Clear Method | Count Property | Item Method | Remove Method