Skip to main content

Build Testing Pypi

What is this?

Backup tool for PowerDNS database (MySQL) to local or S3 storage in bind format. Open metrics are also computed on your feched zones.

PyPI

python 3.14.x python 3.13.x python 3.12.x python 3.11.x

Deploy the pdnsbackup tool in your server with the pip command.

pip install pdnsbackup

Usage

After installation, you can execute the pdnsbackup to start-it.

$ pdnsbackup -h
usage: -c [-h] [-c C] [-e E] [-v]

options:
  -h, --help  show this help message and exit
  -c C        external config file
  -e E        env config file
  -v          debug mode

Configuration

This tool can be configurated with severals ways. See the default config file:

  • from external configuration file (-c config argument)

  • from environment variables (-e env file argument)

Variables Description
PDNSBACKUP_DEBUG debug mode 1 or 0
PDNSBACKUP_GMYSQL_ENABLED set to 1 to enable gmysql backend, enabled by default
PDNSBACKUP_GMYSQL_HOST mysql port, default is 127.0.0.1
PDNSBACKUP_GMYSQL_PORT mysql port, default is 3306
PDNSBACKUP_GMYSQL_SSL enable ssl, default is 0
PDNSBACKUP_GMYSQL_DBNAME mysql database name
PDNSBACKUP_GMYSQL_USER mysql user
PDNSBACKUP_GMYSQL_PASSWORD mysql password
PDNSBACKUP_FILE_ENABLED set to 1 enable backup to file, enabled by default
PDNSBACKUP_FILE_PATH_BIND zone bind path in named.conf
PDNSBACKUP_FILE_PATH_OUTPUT output folder of the export
PDNSBACKUP_S3_ENABLED set to 1 enable backup to S3 storage, disabled by default
PDNSBACKUP_S3_ENDPOINT_URL your s3 url
PDNSBACKUP_S3_SSL_VERIFY disable ssl verify
PDNSBACKUP_S3_ACCESS_KEY_ID your access key
PDNSBACKUP_S3_SECRET_ACCESS_KEY your secret access key
PDNSBACKUP_S3_BUCKET_NAME bucket name
PDNSBACKUP_S3_BACKUP_FILE backup file name
PDNSBACKUP_S3_BACKUP_DELETE_OLDER delete backups older than xx days
PDNSBACKUP_METRICS_ENABLED export open metrics
PDNSBACKUP_METRICS_PROM_FILE write metrics to file path

Metrics

This tool can be used to compute statistics on your DNS records.

Variables Description
pdnsbackup_status Status of the backup process
pdnsbackup_zones_total Total number of zones
pdnsbackup_zones_empty_total Total number of empty zones
pdnsbackup_records_total Total number of records per DNS zones
pdnsbackup_wildcards_total Total number of DNS wilcards
pdnsbackup_delegations_total Total number of DNS delegations
pdnsbackup_rrtypes_total Total number of records per type (A, AAAA, CNAME, ...)

Docker run

sudo docker run --rm --env-file ./.env --name=pdnsbackup dmachard/pdnsbackup:latest

Run from source

Create a .env file to populate your variable

Create a virtualenv

python -m venv venv
source venv/bin/activate

Install requirements and run-it

python3 -m pip install -r requirements.txt
python3 -c "import pdnsbackup; pdnsbackup.run();"
python3 -c "import pdnsbackup; pdnsbackup.run();" -c tests/config.yml
python3 -c "import pdnsbackup; pdnsbackup.run();" -e tests/.env

Build and run from docker image

sudo docker build . --file Dockerfile -t pdnsbackup

Run tests

powerdns auth 5.0.x powerdns auth 4.9.x powerdns auth 4.8.x

Run all tests

python -m unittest discover -v tests/

Run one by one

python -m unittest -v tests.test_config
python -m unittest -v tests.test_parser
python -m unittest -v tests.test_import
python -m unittest -v tests.test_export_file
python -m unittest -v tests.test_export_metrics

Download files

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

Source Distribution

pdnsbackup-1.0.11.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdnsbackup-1.0.11-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pdnsbackup-1.0.11.tar.gz.

File metadata

  • Download URL: pdnsbackup-1.0.11.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pdnsbackup-1.0.11.tar.gz
Algorithm Hash digest
SHA256 e5baa565cae46f5dad5a388dc8d9e4a9b84bbdbd45b943a5376b2ff5a25a961d
MD5 7ad39aae601807ff8418a20b3b3a4c50
BLAKE2b-256 e32fe82ad65d4e6cede6a9e20d0cdb1478a5d5a5ccef15a8230de6b96d23e42f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdnsbackup-1.0.11.tar.gz:

Publisher: publish.yml on dmachard/pdns-backup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdnsbackup-1.0.11-py3-none-any.whl.

File metadata

  • Download URL: pdnsbackup-1.0.11-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pdnsbackup-1.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 349bb1c9d24634c52d39a47229f8d3967e2e190f2f3e5911147e83ee6dca353a
MD5 133300b48c41806cd96fd9eaf6b54526
BLAKE2b-256 c09d2e301099848c4d3cf8300d587e3baadf884641c2a187432fba6dc8ad8253

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdnsbackup-1.0.11-py3-none-any.whl:

Publisher: publish.yml on dmachard/pdns-backup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.0.11 This release

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

0.12.0

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.3

2 files

0.0.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page