<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>easyzone</name>
<shortdesc>Easy Zone - DNS Zone abstraction module</shortdesc>
<description>easyzone
========

Overview
--------

Easyzone is a package to manage the common record types of a
zone file, including SOA records.  This module sits on top of
the dnspython package and provides a higher level abstraction
for common zone file manipulation use cases.

Main features:

* A high-level abstraction on top of dnspython.
* Load a zone file into objects.
* Modify/add/delete zone/record objects.
* Save back to zone file.
* Auto-update serial (if necessary).


Requirements
------------

  * dnspython - http://www.dnspython.org/


Build/Test/Install
------------------

Build::

  $ python setup.py build

Test::

  $ python setup.py test

Install::

  $ python setup.py install


OR with setuptools::

  $ easy_install easyzone


Examples
--------

easyzone::

  &gt;&gt;&gt; from easyzone import easyzone
  &gt;&gt;&gt; z = easyzone.zone_from_file('example.com', '/var/namedb/example.com')
  &gt;&gt;&gt; z.domain
  'example.com.'
  &gt;&gt;&gt; z.root.soa.serial
  2007012902L
  &gt;&gt;&gt; z.root.records('NS').items
  ['ns1.example.com.', 'ns2.example.com.']
  &gt;&gt;&gt; z.root.records('MX').items
  [(10, 'mail.example.com.'), (20, 'mail2.example.com.')]
  &gt;&gt;&gt; z.names['foo.example.com.'].records('A').items
  ['10.0.0.1']

  &gt;&gt;&gt; ns = z.root.records('NS')
  &gt;&gt;&gt; ns.add('ns3.example.com.')
  &gt;&gt;&gt; ns.items
  ['ns1.example.com.', 'ns2.example.com.', 'ns3.example.com.']
  &gt;&gt;&gt; ns.delete('ns2.example.com')
  &gt;&gt;&gt; ns.items
  ['ns1.example.com.', 'ns3.example.com.']

  &gt;&gt;&gt; z.save(autoserial=True)

ZoneCheck::

  &gt;&gt;&gt; from easyzone.zone_check import ZoneCheck
  &gt;&gt;&gt; c = ZoneCheck()
  &gt;&gt;&gt; c.isValid('example.com', '/var/named/zones/example.com')
  True
  &gt;&gt;&gt; c.isValid('foo.com', '/var/named/zones/example.com')
  False
  &gt;&gt;&gt; c.error
  'Bad syntax'
  &gt;&gt;&gt; 
  &gt;&gt;&gt; c = ZoneCheck(checkzone='/usr/sbin/named-checkzone')
  &gt;&gt;&gt; c.isValid('example.com', '/var/named/zones/example.com')
  True
  &gt;&gt;&gt;

ZoneReload::

  &gt;&gt;&gt; from easyzone.zone_reload import ZoneReload
  &gt;&gt;&gt; r = ZoneReload()
  &gt;&gt;&gt; r.reload('example.com')
  zone reload up-to-date
  &gt;&gt;&gt; r.reload('foo.com')
  rndc: 'reload' failed: not found
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "easyzone/zone_reload.py", line 51, in reload
      raise ZoneReloadError("rndc failed with return code %d" % r)
  easyzone.zone_reload.ZoneReloadError: rndc failed with return code 1
  &gt;&gt;&gt; 
  &gt;&gt;&gt; r = ZoneReload(rndc='/usr/sbin/rndc')
  &gt;&gt;&gt; r.reload('example.com')
  zone reload up-to-date
  &gt;&gt;&gt;</description>
<homepage rdf:resource="http://www.psychofx.com/easyzone/" />
<maintainer><foaf:Person><foaf:name>Chris Miles</foaf:name>
<foaf:mbox_sha1sum>2f7206391f32de99d1af102a211d35a051950092</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>1.2.1</revision></Version></release>
</Project></rdf:RDF>