wodSmtp ActiveX Control - QueryDNS Method
      
 

Description

Sends query to DNS server for the address.


Return Type

None  


Syntax

object.QueryDNS Type, Address, Timeout, [ID]



The QueryDNS Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSmtp.
Type Required. A DnsQueryTypes enumeration, as described in settings. Determines type of request.
Address Required. A String value. Address or domain that needs to be resolved.
Timeout Required. An Integer value. Specifies timeout, in seconds.
ID Optional. A Variant value. Variant value that will be returned back in DNSResponse event.

Settings

The settings for Type are:

Constant Value Description
 QueryMX 0 Sends MX query to DNS server.
 QueryA 1 Sends A query to DNS server.
 QueryPTR 2 Sends PTR query to DNS server.

Remarks

QueryDNS will send DNS request to DNS server specified in DNSHostname property. It can be used for various tasks related to hostnames and domains connecting to your SMTP server. For example, you can use it to determine MX or A records for given email, so you can fill Hostname property by yourself.

When QueryDNS is used, it will send request to the server. When response arrives from the server, DNSResponse event will be fired where you can read result of your query. If error occurs, DNSResponse event will contain Success argument that will tell you if your query was successful or not.

If server replies with answer that was not expected, recursive queries are automatically resent by wodSmtp. For example, DNS server may reply that it's not authoritative for your query and will point you to another DNS server. wodSmtp will automatically resend the request - until response is received or timeout expires.

QueryDNS can be used anytime and any number of times.