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

Module dns.zone

DNS Zones.
Classes
Zone A DNS zone.

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.

Function Summary
dns.zone.Zone object from_file(f, origin, rdclass, relativize, zone_factory, filename, allow_include)
Read a master file and build a zone object.
dns.zone.Zone object from_text(text, origin, rdclass, relativize, zone_factory, filename, allow_include)
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, rdclass=1, relativize=True, zone_factory=<class 'dns.zone.Zone'>, filename=None, allow_include=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.
           (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)
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, rdclass=1, relativize=True, zone_factory=<class 'dns.zone.Zone'>, filename=None, allow_include=False)

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.
           (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)
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
           (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 Sun Jul 31 21:35:42 2005 http://epydoc.sf.net