DNS Class

Properties   Methods   Events   Configuration Settings   Errors  

The DNS class is used to query DNS for record information.

Syntax

class ipworks.DNS

Remarks

The DNS class queries a DNS server for records as specified in RFC 1035 and other relevant RFCs. The class property query_type indicates the record to be queried. Calling query will initiate the query.

Once the query is complete, a single on_response event will fire and the record properties will be filled. status_code 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.

dns_portThe port to connect to on the DNS Server.
dns_serverThe address of the DNS server.
idleThe current status of the class.
local_hostThe name of the local host or user-assigned IP interface through which connections are initiated or accepted.
protocolThe protocol used for the DNS request.
query_typeThe record type to query.
record_countThe number of records in the Record arrays.
record_domainThis property contains the domain name associated with the selected response record, at RecordIndex .
record_field_countThis property contains the number of properties in the current record.
record_field_indexThis property contains the index of the selected property of the current record.
record_field_nameThis property contains the name of the property selected by FieldIndex .
record_field_valueThis property contains the value of the property selected by FieldIndex .
record_dataThis property contains the full record data as received from the DNS server.
record_typeThis property contains the record type.
record_type_nameThis property contains the string representation of the current record type defined by RecordType .
record_ttlThis property contains the record Time To Live (TTL) value.
record_sourceThe source of records provided in the Records properties.
recursiveDetermines whether to ask the DNSServer to recursively query other servers.
request_idThe ID of the current DNS request.
statusA standard string interpretation of StatusCode .
status_codeThe success or error code for the DNS query.
timeoutA 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.

configSets or retrieves a configuration setting.
do_eventsProcesses events from the internal message queue.
get_field_valueGet the value of the field indicated from a record.
interruptInterrupt the current method.
queryQuery a Domain.
resetReset 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.

on_errorInformation about errors during data delivery.
on_responseFires after a DNS query.
on_ssl_server_authenticationFires when connecting to the server.
on_ssl_statusShows 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.

DoHMethodSpecifies the DNS over HTTPS method.
ResponseTruncatedWhether the response is truncated.
UseDNSAPIDLLWhether to use the system dnsapi.dll on Windows Systems.
UseIDNsWhether to encode hostnames to internationalized domain names.
CaptureIPPacketInfoUsed to capture the packet information.
DestinationAddressUsed to get the destination address from the packet information.
DontFragmentUsed to set the Don't Fragment flag of outgoing packets.
LocalHostThe name of the local host through which connections are initiated or accepted.
LocalPortThe port in the local host where the class binds.
MaxPacketSizeThe maximum length of the packets that can be received.
QOSDSCPValueUsed to specify an arbitrary QOS/DSCP setting (optional).
QOSTrafficTypeUsed to specify QOS/DSCP settings (optional).
ShareLocalPortIf set to True, allows more than one instance of the class to be active on the same local port.
SourceIPAddressUsed to set the source IP address used when sending a packet.
SourceMacAddressUsed to set the source MAC address used when sending a packet.
UseConnectionDetermines whether to use a connected socket.
UseIPv6Whether or not to use IPv6.
AbsoluteTimeoutDetermines whether timeouts are inactivity timeouts or absolute timeouts.
FirewallDataUsed to send extra data to the firewall.
InBufferSizeThe size in bytes of the incoming queue of the socket.
OutBufferSizeThe size in bytes of the outgoing queue of the socket.
BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
ProcessIdleEventsWhether the class uses its internal event loop to process events when the main thread is idle.
SelectWaitMillisThe length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.
UseInternalSecurityAPITells the class whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]