Perform a general nameserver query for a specific type of
record.
Syntax
object.Query( RecordName,
RecordType, RecordData, [Reserved] )
Remarks
The Query method performs a general nameserver query for
a given record based on the name and type. This method will not use
a local host file when performing host name or IP address
lookups.
The RecordName string argument specifies the name of the
record that is to be retrieved. Typically this is the name of a
given host for which you wish to obtain information.
The RecordType integer argument specifies the type of
record that is to be retrieved. This argument should be set to one
of the following values:
| Value |
Constant |
Description |
| 0 |
dnsRecordNone |
No record type |
| 1 |
dnsRecordAddress |
Host address |
| 2 |
dnsRecordNS |
Authoritative nameserver |
| 5 |
dnsRecordCName |
Cannonical name (alias) |
| 6 |
dnsRecordSOA |
Start of Authority |
| 11 |
dnsRecordWKS |
Well known services |
| 12 |
dnsRecordPTR |
Domain name |
| 13 |
dnsRecordHInfo |
Host information |
| 14 |
dnsRecordMInfo |
Mailbox information |
| 15 |
dnsRecordMX |
Mail exchange host |
| 16 |
dnsRecordTXT |
Text strings |
| 29 |
dnsRecordLoc |
Location information |
| 100 |
dnsRecordUInfo |
User information |
| 101 |
dnsRecordUid |
User ID |
| 102 |
dnsRecordGid |
Group ID |
The dnsRecordAddress record type is used to resolve a
host name into an IP address, and is the most common type of
nameserver query that is performed. This is the type of query that
is used when you set the HostName property and then read the
HostAddress property to obtain it's IP address.
The dnsRecordPTR record type is used to resolve an IP
address into a host name, and is also referred to as a reverse DNS
lookup. The RecordName argument should be set to the IP
address of the system, and the RecordData argument will
contain its fully qualified domain name when the method returns.
Note that this requires that a PTR record actually exists for the
given address, which may not be the case. This is the same type of
query that is performed when you set the HostAddress
property and then read the HostName property to determine
the host name.
The RecordData string argument is set to the data
returned as a result of the query. If no data was returned, this
argument will be set to an empty string.
The Reserved argument is ignored and should be omitted or
passed as an empty variant. This argument is reserved for future
use in the control.
Return Value
A value of zero is returned if the operation was successful,
otherwise a non-zero error code is returned which indicates the
cause of the failure.
See Also
HostAddress Property,
HostName Property, MailExchange Property, Resolve Method
|