{"id":15673861,"url":"https://github.com/greg-hellings/dnszone","last_synced_at":"2025-04-15T01:04:51.177Z","repository":{"id":34193660,"uuid":"171332455","full_name":"greg-hellings/dnszone","owner":"greg-hellings","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-06T03:05:30.000Z","size":51,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T13:01:34.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greg-hellings.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-18T18:11:07.000Z","updated_at":"2024-09-06T03:05:34.000Z","dependencies_parsed_at":"2024-10-23T11:26:04.897Z","dependency_job_id":null,"html_url":"https://github.com/greg-hellings/dnszone","commit_stats":{"total_commits":33,"total_committers":6,"mean_commits":5.5,"dds":0.4545454545454546,"last_synced_commit":"0146ab71419265a9627bcddd724e23f765e7860e"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-hellings%2Fdnszone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-hellings%2Fdnszone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-hellings%2Fdnszone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greg-hellings%2Fdnszone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greg-hellings","download_url":"https://codeload.github.com/greg-hellings/dnszone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246307658,"owners_count":20756474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T15:42:39.556Z","updated_at":"2025-03-30T10:30:58.979Z","avatar_url":"https://github.com/greg-hellings.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"dnszone\n========\n\nOverview\n--------\n\nThis package is forked from [Easyzone](https://bitbucket.org/chrismiles/easyzone),\ncreated by Chris Miles. I have forked it to include bugfixes for installation\nand also to update the package for compatibility with Python 3.\n\nDNSZone is a package to manage the common record types of a\nzone file, including SOA records.  This module sits on top of\nthe dnspython package and provides a higher level abstraction\nfor common zone file manipulation use cases.\n\nMain features:\n\n* A high-level abstraction on top of dnspython.\n* Load a zone file into objects.\n* Modify/add/delete zone/record objects.\n* Save back to zone file.\n* Auto-update serial (if necessary).\n\nWebsites:\n* http://pypi.python.org/pypi/dnszone\n* https://github.com/greg-hellings/dnszone/\n\n\nRequirements\n------------\n\n  * [dnspython](http://www.dnspython.org/)\n\n\nBuild/Test/Install\n------------------\n\nBuild::\n\n```bash\n  $ python setup.py build\n```\n\nTest::\n\n```bash\n  $ python setup.py test\n```\n\nInstall::\n\n```bash\n  $ python setup.py install\n```\n\n\nOR with setuptools::\n\n```bash\n  $ easy_install dnszone\n```\n\n\nExamples\n--------\n\ndnszone::\n\n```\n  \u003e\u003e\u003e from dnszone import dnszone\n  \u003e\u003e\u003e z = dnszone.zone_from_file('example.com', '/var/namedb/example.com')\n  \u003e\u003e\u003e z.domain\n  'example.com.'\n  \u003e\u003e\u003e z.root.soa.serial\n  2007012902L\n  \u003e\u003e\u003e z.root.records('NS').items\n  ['ns1.example.com.', 'ns2.example.com.']\n  \u003e\u003e\u003e z.root.records('MX').items\n  [(10, 'mail.example.com.'), (20, 'mail2.example.com.')]\n  \u003e\u003e\u003e z.names['foo.example.com.'].records('A').items\n  ['10.0.0.1']\n\n  \u003e\u003e\u003e ns = z.root.records('NS')\n  \u003e\u003e\u003e ns.add('ns3.example.com.')\n  \u003e\u003e\u003e ns.items\n  ['ns1.example.com.', 'ns2.example.com.', 'ns3.example.com.']\n  \u003e\u003e\u003e ns.delete('ns2.example.com')\n  \u003e\u003e\u003e ns.items\n  ['ns1.example.com.', 'ns3.example.com.']\n\n  \u003e\u003e\u003e z.save(autoserial=True)\n```\n\nZoneCheck::\n\n```\n  \u003e\u003e\u003e from dnszone.zone_check import ZoneCheck\n  \u003e\u003e\u003e c = ZoneCheck()\n  \u003e\u003e\u003e c.isValid('example.com', '/var/named/zones/example.com')\n  True\n  \u003e\u003e\u003e c.isValid('foo.com', '/var/named/zones/example.com')\n  False\n  \u003e\u003e\u003e c.error\n  'Bad syntax'\n  \u003e\u003e\u003e\n  \u003e\u003e\u003e c = ZoneCheck(checkzone='/usr/sbin/named-checkzone')\n  \u003e\u003e\u003e c.isValid('example.com', '/var/named/zones/example.com')\n  True\n  \u003e\u003e\u003e\n```\n\nZoneReload::\n\n```\n  \u003e\u003e\u003e from dnszone.zone_reload import ZoneReload\n  \u003e\u003e\u003e r = ZoneReload()\n  \u003e\u003e\u003e r.reload('example.com')\n  zone reload up-to-date\n  \u003e\u003e\u003e r.reload('foo.com')\n  rndc: 'reload' failed: not found\n  Traceback (most recent call last):\n    File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n    File \"dnszone/zone_reload.py\", line 51, in reload\n      raise ZoneReloadError(\"rndc failed with return code %d\" % r)\n  dnszone.zone_reload.ZoneReloadError: rndc failed with return code 1\n  \u003e\u003e\u003e\n  \u003e\u003e\u003e r = ZoneReload(rndc='/usr/sbin/rndc')\n  \u003e\u003e\u003e r.reload('example.com')\n  zone reload up-to-date\n  \u003e\u003e\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-hellings%2Fdnszone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreg-hellings%2Fdnszone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreg-hellings%2Fdnszone/lists"}