Skip to main content

The dnssync script allows DNS zones hosted at various DNS providers to be synchronized with local bind-style text zone files. This allows the DNS zones to be easily version-controlled, even if the service provider does not directly support that.

Currently supported DNS service providers:

Project

Installation

$ pip install dnssync

Usage

To download a zone from PowerDNS:

$ dnssync download --driver powerdns --param apikey={KEY} --domain {DOMAIN} {ZONEFILE}

These command line options can also be stored in a configuration file, e.g. config.ini:

driver        = powerdns
apikey        = {KEY}
domain        = {DOMAIN}
zonefile      = {ZONEFILE}

And then invoke dnssync as follows:

$ dnssync download --config config.ini

To upload a zone:

$ dnssync upload --config config.ini

And to show differences between the hosted zone and the local zonefile:

$ dnssync diff --config config.ini

And to test that a DNS server is serving the zone as specified:

$ dnssync verify --config config.ini

Note that the verify command has some limitations in how accurate it can be. For example, record-level TTL’s cannot be extracted from DNS (only remaining time, not total time, to expiry).

Configuration

The dnssync configuration file can specify the following options:

  • driver:

    The driver for the specific DNS hosting service; currently supported values:

    • domainmonster: for DomainMonster.com

    • powerdns: for PowerDNS.net

    • zoneedit: for ZoneEdit.com

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

DomainMonster

The following options exist for the domainmonster driver:

  • username:

    The username of the account to log into DomainMonster with.

  • password:

    The password of the specified username account.

PowerDNS

The following options exist for the powerdns driver:

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

ZoneEdit

The following options exist for the zoneedit driver:

  • username:

    The username of the account to log into ZoneEdit with.

  • password:

    The password of the specified username account.

Multiple Profiles

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
driver        = powerdns
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'
$ dnssync upload -c config.ini

# upload 'other-example.com'
$ dnssync upload -c config.ini -d other-example.com

Zonefile Local Variables

The zonefile can also specify the configuration file via emacs-style local variables. The configuration file specified on the command line, however, takes precedence. For example, given the following example-com.zone zonefile:

;; -*- coding: utf-8; dnssync-config: config.ini -*-

$ORIGIN example.com.
example.com. 3600 IN SOA ...
... more DNS records ...

The following command will pull all options from the config.ini file:

# report differences
$ dnssync diff example-com.zone

# upload a new version
$ dnssync upload example-com.zone

Metadata

Release files for dnssync 0.2.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dnssync 0.2.7
File Size Uploaded Provenance
dnssync-0.2.7.tar.gz 41.9 kB Without provenance Details

Release files / dnssync-0.2.7.tar.gz

Download URL dnssync-0.2.7.tar.gz
Size 41.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4f4028ce27be0d51911254c08bace6af5dfd5d6172a87dab87224f310a47fb46
BLAKE2b-256 checksum
How to use checksums
47eb7a574259ddd84b69c4af6cfe8a7e1a1ede45167801f60f3f9153108ba0c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for dnssync 0.2.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page