Skip to main content

Python client for ISC BIND's RNDC

Project description

rndc-python

Python client library for talking to ISC BIND's RNDC service.

Requirements

  • Python 3.10+

Installation

pip install rndc-python

Or using uv:

uv add rndc-python

Command-line Interface

The package includes a CLI tool rndc-python-cli:

# Using CLI options
rndc-python-cli -s 127.0.0.1 -p 953 -a sha256 -k <base64-secret> status

# Using environment variables
export ZPAPI_RNDC_HOST=127.0.0.1
export ZPAPI_RNDC_PORT=953
export ZPAPI_RNDC_ALGORITHM=sha256
export ZPAPI_RNDC_SECRET=<base64-secret>
rndc-python-cli status

# Mix of both (CLI options override env vars)
rndc-python-cli --port 954 reload

Configuration

The client can read its settings from environment variables (or a .env file):

  • ZPAPI_RNDC_HOST
  • ZPAPI_RNDC_PORT
  • ZPAPI_RNDC_ALGORITHM (e.g. hmac-sha256)
  • ZPAPI_RNDC_SECRET
  • ZPAPI_RNDC_TIMEOUT
  • ZPAPI_RNDC_MAX_RETRIES
  • ZPAPI_RNDC_RETRY_DELAY

You can also configure the client directly in Python:

from rndc_python import RNDCClient, TSIGAlgorithm

client = RNDCClient(
    host="127.0.0.1",
    port=953,
    algorithm=TSIGAlgorithm.SHA256,
    secret="your-base64-secret-here",
    timeout=10,
    max_retries=3,
    retry_delay=2,
)

All parameters are optional if you have configured environment variables or a .env file.

Usage

Python API

from rndc_python import RNDCClient

with RNDCClient() as rndc_client:
    print(rndc_client.call("status"))

Development

See DEVELOPMENT.md for development setup, building, and testing instructions.

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

rndc_python-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

rndc_python-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file rndc_python-0.1.0.tar.gz.

File metadata

  • Download URL: rndc_python-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for rndc_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fea30e4a3a5a2cbcc641376ec0c1f117642212d11c9568e7e309ec0b18ada065
MD5 03cc585d3e9badb769f9aec9b0e5d7dd
BLAKE2b-256 e22299e6f0a2487ae332848693829a8cdfb98604f6538122e1d3cbb7f9c4fb37

See more details on using hashes here.

File details

Details for the file rndc_python-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for rndc_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3391e9b3b45b475ff645a19b87d8d572409797da5fab3c8b1d043cccaf8c0ef3
MD5 a81356da8cf5616cf0e71ce635191294
BLAKE2b-256 e3b4ecc93788b9466b5a4a7b4dc6bffc47d6c9d3103b475202cc0d6bab4d2731

See more details on using hashes here.

Supported by

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