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

Module dns.zone

DNS Zones.
Classes
Zone A DNS zone.
_MasterReader Read a DNS master file

Exceptions
BadZone The zone is malformed.
NoNS The zone has no NS RRset at its origin.
NoSOA The zone has no SOA RR at its origin.
UnknownOrigin The zone's origin is unknown.

Function Summary
dns.zone.Zone object from_file(f, origin, rdclass, relativize, zone_factory, filename, allow_include, check_origin)
Read a master file and build a zone object.
dns.zone.Zone object from_text(text, origin, rdclass, relativize, zone_factory, filename, allow_include, check_origin)
Build a zone object from a master file format string.
dns.zone.Zone object from_xfr(xfr, zone_factory, relativize)
Convert the output of a zone transfer generator into a zone object.

Function Details

from_file(f, origin=None, rdclass=1, relativize=True, zone_factory=<class 'dns.zone.Zone'>, filename=None, allow_include=True, check_origin=True)

Read a master file and build a zone object.
Parameters:
f - file or string. If f is a string, it is treated as the name of a file to open.
origin - The origin of the zone; if not specified, the first $ORIGIN statement in the master file will determine the origin of the zone.
           (type=dns.name.Name object or string)
rdclass - The zone's rdata class; the default is class IN.
           (type=int)
relativize - should names be relativized? The default is True
           (type=bool)
zone_factory - The zone factory to use
           (type=function returning a Zone)
filename - The filename to emit when describing where an error occurred; the default is '<file>', or the value of f if f is a string.
           (type=string)
allow_include - is $INCLUDE allowed?
           (type=bool)
check_origin - should sanity checks of the origin node be done? The default is True.
           (type=bool)
Returns:
dns.zone.Zone object
Raises:
dns.zone.NoSOA - No SOA RR was found at the zone origin
dns.zone.NoNS - No NS RRset was found at the zone origin

from_text(text, origin=None, rdclass=1, relativize=True, zone_factory=<class 'dns.zone.Zone'>, filename=None, allow_include=False, check_origin=True)

Build a zone object from a master file format string.
Parameters:
text - the master file format input
           (type=string.)
origin - The origin of the zone; if not specified, the first $ORIGIN statement in the master file will determine the origin of the zone.
           (type=dns.name.Name object or string)
rdclass - The zone's rdata class; the default is class IN.
           (type=int)
relativize - should names be relativized? The default is True
           (type=bool)
zone_factory - The zone factory to use
           (type=function returning a Zone)
filename - The filename to emit when describing where an error occurred; the default is '<string>'.
           (type=string)
allow_include - is $INCLUDE allowed?
           (type=bool)
check_origin - should sanity checks of the origin node be done? The default is True.
           (type=bool)
Returns:
dns.zone.Zone object
Raises:
dns.zone.NoSOA - No SOA RR was found at the zone origin
dns.zone.NoNS - No NS RRset was found at the zone origin

from_xfr(xfr, zone_factory=<class 'dns.zone.Zone'>, relativize=True)

Convert the output of a zone transfer generator into a zone object.
Parameters:
xfr - The xfr generator
           (type=generator of dns.message.Message objects)
relativize - should names be relativized? The default is True. It is essential that the relativize setting matches the one specified to dns.query.xfr().
           (type=bool)
Returns:
dns.zone.Zone object
Raises:
dns.zone.NoSOA - No SOA RR was found at the zone origin
dns.zone.NoNS - No NS RRset was found at the zone origin

Generated by Epydoc 2.1 on Fri Jun 2 14:38:18 2006 http://epydoc.sf.net