Skip to main content

Python client for dnsdist console

Project description

Python client for dnsdist console

Author Denis Machard d.machard@gmail.com
License MIT
PyPI https://pypi.org/project/dnsdist_console/

This is a Python 3 client for the dnsdist console

Table of contents

Installation

pip3 install dnsdist_console

Authentication

from dnsdist_console import Console

Generate key

Generate a shared secret key. It will be used between the client and the server.

from dnsdist_console import Key

k = Key().generate()
print(k)
OTgmgAR6zbrfrYlKgsAAJn+by4faMqI1bVCvzacXMW0=

Save-it in your /etc/dnsdist/dnsdist.conf with the setKey directive.

Send command to the console

from dnsdist_console import Console

console_ip = "127.0.0.1"
console_port = 5199
console_key = "GQpEpQoIuzA6kzgwDokX9JcXPXFvO1Emg1wAXToJ0ag="

console = Console(host=console_ip,
                  port=console_port, 
                  key=console_key)

o = console.send_command(cmd="showVersion()")
print(o)
dnsdist 1.4.0

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

dnsdist_console-0.2.0.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

dnsdist_console-0.2.0-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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