Skip to main content

An API and CLI client for Hetzner DNS service.

Project description


An API and CLI tools for Hetzner DNS. It is work in progress, the functionality is added as required.

Hetzner DNS Docs


pip install hetznerdns


To use the CLI client, you need to generate access token in the Hetzner DNS web frontend. CLI client configuration is done via environment variables.

export HETZNER_DNS_TOKEN=token

At the moment, it is possible to get/create/delete zones and records, for example:

$ hetznerdns-cli zone get --name
{'id': 'tfJ9nMJckFAV7LBghxWTNB', 'name': '', 'ttl': 86400, 'registrar': '', 'legacy_dns_host': '', 'legacy_ns': ['', '', ''], 'ns': ['', '', ''], 'created': '2021-01-22 13:26:21.526 +0000 UTC', 'verified': '', 'modified': '2021-01-22 13:26:22.479 +0000 UTC', 'project': '', 'owner': '', 'permission': '', 'zone_type': {'id': '', 'name': '', 'description': '', 'prices': None}, 'status': 'verified', 'paused': False, 'is_secondary_dns': False, 'txt_verification': {'name': '', 'token': ''}, 'records_count': 4}

$ hetznerdns-cli zone create --name
$ hetznerdns-cli zone get --name
{'id': '5DFHAbGXmHX8ojKh6Prs8H', 'name': '', 'ttl': 3600, 'registrar': '', 'legacy_dns_host': '', 'legacy_ns': [], 'ns': ['', '', ''], 'created': '2021-02-05 12:57:21.941 +0000 UTC', 'verified': '', 'modified': '2021-02-05 12:57:21.941 +0000 UTC', 'project': '', 'owner': '', 'permission': '', 'zone_type': {'id': '', 'name': '', 'description': '', 'prices': None}, 'status': 'verified', 'paused': False, 'is_secondary_dns': False, 'txt_verification': {'name': '', 'token': ''}, 'records_count': 0}

$ hetznerdns-cli zone delete --name
$ hetznerdns-cli record create --name www --type A --value --zone-name
{'record': {'id': '1ed054dbcc1b6445f10e5a86a6f9539b', 'type': 'A', 'name': 'www', 'value': '', 'ttl': 3600, 'zone_id': 'tfJ9nMJckFAV7LBghxWTNB', 'created': '2021-02-05 12:58:39.63 +0000 UTC', 'modified': '2021-02-05 12:58:39.63 +0000 UTC'}}

$ hetznerdns-cli record get --name www --zone-name
{'id': '1ed054dbcc1b6445f10e5a86a6f9539b', 'type': 'A', 'name': 'www', 'value': '', 'ttl': 3600, 'zone_id': 'tfJ9nMJckFAV7LBghxWTNB', 'created': '2021-02-05 12:58:39.63 +0000 UTC', 'modified': '2021-02-05 12:58:39.63 +0000 UTC'}

$ hetznerdns-cli record delete --name www --zone-name


# Create virtual environment for python3
# Then inside the environment execute
git clone && cd hetznerdns-py
pip install -e .
pip install -r requirements-dev.txt
make test

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

hetznerdns-1.0.6.tar.gz (4.6 kB view hashes)

Uploaded source

Built Distribution

hetznerdns-1.0.6-py3-none-any.whl (6.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page