Package dns :: Module query
[show private | hide private]
[frames | no frames]

Module dns.query

Talk to a DNS server.
Exceptions
BadResponse Raised if a query response does not respond to the question asked.
UnexpectedSource Raised if a query response comes from an unexpected address or port.

Function Summary
dns.message.Message object tcp(q, where, timeout, port, af)
Return the response obtained after sending a query via TCP.
dns.message.Message object udp(q, where, timeout, port, af)
Return the response obtained after sending a query via UDP.
generator of dns.message.Message objects. xfr(where, zone, rdtype, rdclass, timeout, port, keyring, keyname, relativize, af, lifetime)
Return a generator for the responses to a zone transfer.

Variable Summary
_Feature generators

Function Details

tcp(q, where, timeout=None, port=53, af=2)

Return the response obtained after sending a query via TCP.
Parameters:
q - the query
           (type=dns.message.Message object)
timeout - The number of seconds to wait before the query times out. If None, the default, wait forever.
           (type=float)
port - The port to which to send the message. The default is 53.
           (type=int)
af - the address family to use. The default is socket.AF_INET.
           (type=int)
Returns:
dns.message.Message object

udp(q, where, timeout=None, port=53, af=2)

Return the response obtained after sending a query via UDP.
Parameters:
q - the query
           (type=dns.message.Message)
timeout - The number of seconds to wait before the query times out. If None, the default, wait forever.
           (type=float)
port - The port to which to send the message. The default is 53.
           (type=int)
af - the address family to use. The default is socket.AF_INET.
           (type=int)
Returns:
dns.message.Message object

xfr(where, zone, rdtype=252, rdclass=1, timeout=None, port=53, keyring=None, keyname=None, relativize=True, af=2, lifetime=None)

Return a generator for the responses to a zone transfer.
Parameters:
zone - The name of the zone to transfer
           (type=dns.name.Name object or string)
rdtype - The type of zone transfer. The default is dns.rdatatype.AXFR.
           (type=int or string)
rdclass - The class of the zone transfer. The default is dns.rdatatype.IN.
           (type=int or string)
timeout - The number of seconds to wait for each response message. If None, the default, wait forever.
           (type=float)
port - The port to which to send the message. The default is 53.
           (type=int)
keyring - The TSIG keyring to use
           (type=dict)
keyname - The name of the TSIG key to use
           (type=dns.name.Name object or string)
relativize - If True, all names in the zone will be relativized to the zone origin.
           (type=bool)
af - the address family to use. The default is socket.AF_INET.
           (type=int)
lifetime - The total number of seconds to spend doing the transfer. If None, the default, then there is no limit on the time the transfer may take.
           (type=float)
Returns:
generator of dns.message.Message objects.

Variable Details

generators

Type:
_Feature
Value:
_Feature((2, 2, 0, 'alpha', 1), (2, 3, 0, 'final', 0), 4096)           

Generated by Epydoc 1.1 on Fri Nov 7 14:49:27 2003 http://epydoc.sf.net