DNS Class
Properties Methods Events Configuration Settings Errors
The DNS class is used to query DNS for record information.
Syntax
DNS
Remarks
The DNS class queries a DNS server for records as specified in RFC 1035 and other relevant RFCs. The class property QueryType indicates the record to be queried. Calling Query will initiate the query.
Once the query is complete, a single Response event will fire and the record properties will be filled. StatusCode is the server's success or fail code, and Status is a standard string interpretation of the code.
The records are contained in the Records properties. The programming interface is designed to allow a full walk of the records in the DNS response, including provisions for handling new record types.
The class operates synchronously by default (waits for a response before returning control to the caller), however, the class may also operate asynchronously (return control immediately), by setting Timeout to 0. Please refer to the Timeout property for more information.
Property List
The following is the full list of the properties of the class with short descriptions. Click on the links for further details.
DNSPort | The port to connect to on the DNS Server. |
DNSServer | The address of the DNS server. |
Idle | The current status of the class. |
LocalHost | The name of the local host or user-assigned IP interface through which connections are initiated or accepted. |
Protocol | The protocol used for the DNS request. |
QueryType | The record type to query. |
RecordCount | The number of records in the Record arrays. |
RecordDomain | This property contains the domain name associated with the selected response record, at RecordIndex . |
RecordFieldCount | This property contains the number of properties in the current record. |
RecordFieldIndex | This property contains the index of the selected property of the current record. |
RecordFieldName | This property contains the name of the property selected by FieldIndex . |
RecordFieldValue | This property contains the value of the property selected by FieldIndex . |
RecordData | This property contains the full record data as received from the DNS server. |
RecordType | This property contains the record type. |
RecordTypeName | This property contains the string representation of the current record type defined by RecordType . |
RecordTTL | This property contains the record Time To Live (TTL) value. |
RecordSource | The source of records provided in the Records properties. |
Recursive | Determines whether to ask the DNSServer to recursively query other servers. |
RequestId | The ID of the current DNS request. |
Status | A standard string interpretation of StatusCode . |
StatusCode | The success or error code for the DNS query. |
Timeout | A timeout for the class. |
Method List
The following is the full list of the methods of the class with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
DoEvents | Processes events from the internal message queue. |
GetFieldValue | Get the value of the field indicated from a record. |
Interrupt | Interrupt the current method. |
Query | Query a Domain. |
Reset | Reset the class. |
Event List
The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Response | Fires after a DNS query. |
SSLServerAuthentication | Fires when connecting to the server. |
SSLStatus | Shows the progress of the secure connection. |
Configuration Settings
The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.
DoHMethod | Specifies the DNS over HTTPS method. |
ResponseTruncated | Whether the response is truncated. |
UseDNSAPIDLL | Whether to use the system dnsapi.dll on Windows Systems. |
UseIDNs | Whether to encode hostnames to internationalized domain names. |
CaptureIPPacketInfo | Used to capture the packet information. |
DestinationAddress | Used to get the destination address from the packet information. |
DontFragment | Used to set the Don't Fragment flag of outgoing packets. |
LocalHost | The name of the local host through which connections are initiated or accepted. |
LocalPort | The port in the local host where the class binds. |
MaxPacketSize | The maximum length of the packets that can be received. |
QOSDSCPValue | Used to specify an arbitrary QOS/DSCP setting (optional). |
QOSTrafficType | Used to specify QOS/DSCP settings (optional). |
ShareLocalPort | If set to True, allows more than one instance of the class to be active on the same local port. |
SourceIPAddress | Used to set the source IP address used when sending a packet. |
SourceMacAddress | Used to set the source MAC address used when sending a packet. |
UseConnection | Determines whether to use a connected socket. |
UseIPv6 | Whether or not to use IPv6. |
AbsoluteTimeout | Determines whether timeouts are inactivity timeouts or absolute timeouts. |
FirewallData | Used to send extra data to the firewall. |
InBufferSize | The size in bytes of the incoming queue of the socket. |
OutBufferSize | The size in bytes of the outgoing queue of the socket. |
BuildInfo | Information about the product's build. |
CodePage | The system code page used for Unicode to Multibyte translations. |
LicenseInfo | Information about the current license. |
ProcessIdleEvents | Whether the class uses its internal event loop to process events when the main thread is idle. |
SelectWaitMillis | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
UseInternalSecurityAPI | Tells the class whether or not to use the system security libraries or an internal implementation. |