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, protocol, message, 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.

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

Method Details

### __init__(self, resolv=None, servers=None, timeout=10)
(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 fail with a `twisted.internet.defer.TimeoutError`
    (type=`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=None)

Make a number of DNS queries via TCP.

  Parameters:
    `queries` - The queries to make.
    (type=Any non-zero number of `dns.Query` instances)
  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 give up the query.
    (type=`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 at 0x81d2bd4>,)

### connections

  Type:
    `None`
  Value:

        None

### factory

  Type:
    `None`
  Value:

        None

### index

  Type:
    `int`
  Value:

        0

### pending

  Type:
    `None`
  Value:

        None

### protocol

  Type:
    `None`
  Value:

        None

### servers

  Type:
    `None`
  Value:

        None

### timeout

  Type:
    `int`
  Value:

        10

Generated by Epydoc 1.1 on Sat Feb 15 21:17:56 2003 | http://epydoc.sf.net