Module t.n.client

Part of twisted.names View Source

Asynchronous client DNS

The functions exposed in this module can be used for asynchronous name resolution and dns queries.

If you need to create a resolver with specific requirements, such as needing to do queries against a particular host, the createResolver function will return an IResolver.

Future plans: Proper nameserver acquisition on Windows/MacOS, better caching, respect timeouts
AuthorJp Calderone
Line # Kind Name Docs
37 Class Resolver
444 Class AXFRController Undocumented
492 Class ThreadedResolver Undocumented
499 Class DNSClientFactory Undocumented
516 Function createResolver Create and return a Resolver.
557 Function getResolver Get a Resolver instance.
574 Function getHostByName Resolve a name to a valid ipv4 or ipv6 address.
596 Function lookupAddress Perform an A record lookup.
611 Function lookupIPV6Address Perform an AAAA record lookup.
626 Function lookupAddress6 Perform an A6 record lookup.
641 Function lookupMailExchange Perform an MX record lookup.
656 Function lookupNameservers Perform an NS record lookup.
671 Function lookupCanonicalName Perform a CNAME record lookup.
686 Function lookupMailBox Perform an MB record lookup.
701 Function lookupMailGroup Perform an MG record lookup.
716 Function lookupMailRename Perform an MR record lookup.
731 Function lookupPointer Perform a PTR record lookup.
746 Function lookupAuthority Perform an SOA record lookup.
761 Function lookupNull Perform a NULL record lookup.
776 Function lookupWellKnownServices Perform a WKS record lookup.
791 Function lookupService Perform an SRV record lookup.
806 Function lookupHostInfo Perform a HINFO record lookup.
821 Function lookupMailboxInfo Perform an MINFO record lookup.
836 Function lookupText Perform a TXT record lookup.
851 Function lookupResponsibility Perform an RP record lookup.
866 Function lookupAFSDatabase Perform an AFSDB record lookup.
881 Function lookupZone Perform an AXFR record lookup.
896 Function lookupAllRecords ALL_RECORD lookup.
913 Function lookupNamingAuthorityPointer NAPTR lookup.
def createResolver(servers=None, resolvconf=None, hosts=None): (source)
Create and return a Resolver.
ParametersserversIf not None, interpreted as a list of addresses of domain name servers to attempt to use. Addresses should be in dotted-quad form. (type: list of (str, int) or None )
resolvconfIf not None, on posix systems will be interpreted as an alternate resolv.conf to use. Will do nothing on windows systems. If None, /etc/resolv.conf will be used. (type: str or None )
hostsIf not None, an alternate hosts file to use. If None on posix systems, /etc/hosts will be used. On windows, C:\windows\hosts will be used. (type: str or None )
Returns (type: IResolver )
def getResolver(): (source)

Get a Resolver instance.

Create twisted.names.client.theResolver if it is None, and then return that value.
Returns (type: IResolver )
def getHostByName(name, timeout=None, effort=10): (source)

Resolve a name to a valid ipv4 or ipv6 address.

Will errback with DNSQueryTimeoutError on a timeout, DomainError or AuthoritativeDomainError (or subclasses) on other errors.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
effortHow many times CNAME and NS records to follow while resolving this name. (type: int )
Returns (type: Deferred )
def lookupAddress(name, timeout=None): (source)
Perform an A record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupIPV6Address(name, timeout=None): (source)
Perform an AAAA record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupAddress6(name, timeout=None): (source)
Perform an A6 record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupMailExchange(name, timeout=None): (source)
Perform an MX record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupNameservers(name, timeout=None): (source)
Perform an NS record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupCanonicalName(name, timeout=None): (source)
Perform a CNAME record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupMailBox(name, timeout=None): (source)
Perform an MB record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupMailGroup(name, timeout=None): (source)
Perform an MG record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupMailRename(name, timeout=None): (source)
Perform an MR record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupPointer(name, timeout=None): (source)
Perform a PTR record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupAuthority(name, timeout=None): (source)
Perform an SOA record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupNull(name, timeout=None): (source)
Perform a NULL record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupWellKnownServices(name, timeout=None): (source)
Perform a WKS record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupService(name, timeout=None): (source)
Perform an SRV record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupHostInfo(name, timeout=None): (source)
Perform a HINFO record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupMailboxInfo(name, timeout=None): (source)
Perform an MINFO record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupText(name, timeout=None): (source)
Perform a TXT record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupResponsibility(name, timeout=None): (source)
Perform an RP record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupAFSDatabase(name, timeout=None): (source)
Perform an AFSDB record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupZone(name, timeout=None): (source)
Perform an AXFR record lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutWhen this timeout expires, the query is considered failed. (type: int )
Returns (type: Deferred )
def lookupAllRecords(name, timeout=None): (source)
ALL_RECORD lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
def lookupNamingAuthorityPointer(name, timeout=None): (source)
NAPTR lookup.
ParametersnameDNS name to resolve. (type: str )
timeoutNumber of seconds after which to reissue the query. When the last timeout expires, the query is considered failed. (type: Sequence of int )
Returns (type: Deferred )
API Documentation for Twisted, generated by pydoctor at 2008-10-26 16:12:37.