Skip to main content

Command line client to synchronize PowerDNS hosted zones with local zone files

Project description

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

Project details


Download files

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

Source Distribution

pdns-0.1.tar.gz (19.8 kB view details)

Uploaded Source

File details

Details for the file pdns-0.1.tar.gz.

File metadata

  • Download URL: pdns-0.1.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pdns-0.1.tar.gz
Algorithm Hash digest
SHA256 7a72eb598e4b71daa3d8327535c595f32819ddeb5c951b9e378723f9abfc2939
MD5 a62c2a7469ac1f34447e5090e3ccf7d3
BLAKE2b-256 4a18323392e2f02767d05613c4458e11eccc8b951b676e42b0293296f3189f97

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page