Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Easy Zone - DNS Zone abstraction module

Project Description

Fork of easyzone from

Includes AAAAA/SRV/PTR records from provnet here:

Also fixes up Exception so they derive from an EasyZone Exception base class, and don’t overwtire NameError.

Fix for python3.



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).




$ python build


$ python test


$ python install

OR with setuptools:

$ easy_install easyzone3

OR with pip:

$ pip install easyzone3



>>> from easyzone import easyzone
>>> z = easyzone.zone_from_file('', '/var/namedb/')
>>> z.domain
>>> z.root.soa.serial
>>> z.root.records('NS').items
['', '']
>>> z.root.records('MX').items
[(10, ''), (20, '')]
>>> z.names[''].records('A').items

>>> ns = z.root.records('NS')
>>> ns.add('')
>>> ns.items
['', '', '']
>>> ns.delete('')
>>> ns.items
['', '']



>>> from easyzone.zone_check import ZoneCheck
>>> c = ZoneCheck()
>>> c.isValid('', '/var/named/zones/')
>>> c.isValid('', '/var/named/zones/')
>>> c.error
'Bad syntax'
>>> c = ZoneCheck(checkzone='/usr/sbin/named-checkzone')
>>> c.isValid('', '/var/named/zones/')


>>> from easyzone.zone_reload import ZoneReload
>>> r = ZoneReload()
>>> r.reload('')
zone reload up-to-date
>>> r.reload('')
rndc: 'reload' failed: not found
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "easyzone/", line 51, in reload
    raise ZoneReloadError("rndc failed with return code %d" % r)
easyzone.zone_reload.ZoneReloadError: rndc failed with return code 1
>>> r = ZoneReload(rndc='/usr/sbin/rndc')
>>> r.reload('')
zone reload up-to-date
Release History

Release History

This version
History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
easyzone3-1.2.3.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Mar 11, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting