interface documentation

class twisted.internet.interfaces.IResolverSimple(Interface): (source)

Known subclasses: twisted.internet.interfaces.IResolver

View In Hierarchy


Method getHostByName Resolve the domain name name into an IP address.
def getHostByName(name, timeout): (source)

Resolve the domain name name into an IP address.

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[int])
ReturnsThe callback of the Deferred that is returned will be passed a string that represents the IP address of the specified name, or the errback will be called if the lookup times out. If multiple types of address records are associated with the name, A6 records will be returned in preference to AAAA records, which will be returned in preference to A records. If there are multiple records of the type to be returned, one will be selected at random. (type: Deferred)
Raisestwisted.internet.defer.TimeoutErrorRaised (asynchronously) if the name cannot be resolved within the specified timeout period.
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.