PowerDNS Command Line Client
The pdns script allows DNS zones hosted at PowerDNS to be synchronized with local bind-style zone files via the PowerDNS API.
Project
Installation
$ pip install pdns
Usage
To download a zone:
$ pdns download --apikey {KEY} --domain {DOMAIN} {ZONEFILE}
These command line options can also be stored in a configuration file, e.g. config.ini:
apikey = {KEY}
domain = {DOMAIN}
zonefile = {ZONEFILE}
And then invoke pdns as follows:
$ pdns download --config config.ini
To upload a zone:
$ pdns upload --config config.ini
And to show differences between the hosted zone and the local zonefile:
$ pdns diff --config config.ini
Configuration
The pdns configuration file can specify the following options:
apikey:
The API access key provided by PowerDNS. Note that an account must first be enabled (via the PowerDNS website) before it can be used.
domain:
The name of the zone to be operated on.
zonefile:
The filename of the local zone file. If specified in the configuration, it is taken to be relative to the configuration file. If specified on the command line, it is taken to be relative to the current working directory.
Several different profiles can be stored in the same configuration; each profile should have a section named after the domain. Global parameters can be stored in the “DEFAULT” section. For example:
[DEFAULT]
# set some global parameters
apikey = 2f16eef6-5b1f-4d80-96f7-0237da03db48
# set the default domain to manage
domain = example.com
[example.com]
zonefile = example-com.zone
[other-example.com]
zonefile = other-example-com.zone
Then, to upload the zones:
# upload 'example.com'
$ pdns upload -c config.ini
# upload 'other-example.com'
$ pdns upload -c config.ini -d other-example.com
Metadata
Release files for pdns 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pdns-0.1.1.tar.gz | 22.7 kB | Details |
Release files / pdns-0.1.1.tar.gz
| Download URL | pdns-0.1.1.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
acab214a040c60af54feb645f1f5b2d205bb8225a226b68a2bcac17b5938bcf7
|
|
BLAKE2b-256 checksum How to use checksums |
1314b6ab0a1f01d8de4bdcb951e5ab0e40967b62e8668ae418bc7d92ea770abf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |