Package twisted :: Package names :: Module client :: Class Resolver

[show private | hide private]
[frames | no frames]

## Class Resolver

    ResolverBase --+
                   |
                  Resolver

Method Summary
| ``__init__`(self, resolv, servers, timeout)`
| `__getstate__(self)`
| `connectionMade(self, protocol)`
| `filterAnswers(self, message)`
| `getHostByName(self, name, timeout, effort)` (inherited from `ResolverBase`)
| `lookupAddress(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupAddress6(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupAFSDatabase(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupAllRecords(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupAuthority(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupCanonicalName(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupHostInfo(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupIPV6Address(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupMailBox(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupMailboxInfo(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupMailExchange(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupMailGroup(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupMailRename(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupNameservers(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupNull(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupPointer(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupResponsibility(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupService(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupText(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupWellKnownServices(self, name, timeout)` (inherited from `ResolverBase`)
| `lookupZone(self, name, timeout)`
| `messageReceived(self, message, protocol, address)`
| `parseConfig(self, conf)`
| ``pickServer`(self)` Return the address of a nameserver.
| `query(self, query, timeout)` (inherited from `ResolverBase`)
`Deferred` | ``queryTCP`(self, queries, timeout)` Make a number of DNS queries via TCP.
`Deferred` @raise `twisted.internet.defer.TimeoutError`: When the query times out. | ``queryUDP`(self, queries, timeout)` Make a number of DNS queries via UDP.
| `_cbRecords(self, (ans, auth, add), name, effort)` (inherited from `ResolverBase`)
| `_lookup(self, name, cls, type, timeout)`
| `_reissue(self, reason, address, query, timeout)`

Class Variable Summary
`tuple` | `__implements__`
`NoneType` | `connections`
`NoneType` | `factory`
`int` | `index`
`NoneType` | `pending`
`NoneType` | `protocol`
`NoneType` | `servers`
`NoneType` | `timeout`

Method Details

### __init__(self, resolv=None, servers=None, timeout=(1, 3, 11, 45))
(Constructor)

  Parameters:
    `resolv` - Filename to read and parse as a resolver(5) configuration file.
    (type=`str`)
    `servers` - If not None, interpreted as a list of addresses of domain name servers to attempt to use for this lookup. Addresses should be in dotted-quad form. If specified, overrides `resolv`.
    (type=`list` of `(str, int)` or `None`)
    `timeout` - Default number of seconds after which to reissue the query. When the last timeout expires, the query is considered failed.
    (type=Sequence of `int`)
  Raises:
    `ValueError` - Raised if no nameserver addresses can be found.

### pickServer(self)

Return the address of a nameserver.

TODO: Weight servers for response time so faster ones can be preferred.

### queryTCP(self, queries, timeout=10)

Make a number of DNS queries via TCP.

  Parameters:
    `queries` - The queries to make.
    (type=Any non-zero number of `dns.Query` instances)
    `timeout` - The number of seconds after which to fail.
    (type=`int`)
  Returns:
    `Deferred`

### queryUDP(self, queries, timeout=None)

Make a number of DNS queries via UDP.

  Parameters:
    `queries` - The queries to make.
    (type=A `list` of `dns.Query` instances)
    `timeout` - Number of seconds after which to reissue the query. When the last timeout expires, the query is considered failed.
    (type=Sequence of `int`)
  Returns:
    `Deferred` @raise `twisted.internet.defer.TimeoutError`: When the query times out.

Class Variable Details

### __implements__

  Type:
    `tuple`
  Value:

        (<class 'twisted.internet.interfaces.IResolver'>,)

### connections

  Type:
    `NoneType`
  Value:

        None

### factory

  Type:
    `NoneType`
  Value:

        None

### index

  Type:
    `int`
  Value:

        0

### pending

  Type:
    `NoneType`
  Value:

        None

### protocol

  Type:
    `NoneType`
  Value:

        None

### servers

  Type:
    `NoneType`
  Value:

        None

### timeout

  Type:
    `NoneType`
  Value:

        None

Generated by Epydoc 1.1 on Thu May 8 13:18:34 2003 | http://epydoc.sf.net