Skip to main content

An API and CLI client for Hetzner DNS service.

Project description

HetznerDNS

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

Hetzner DNS Docs

Installation

pip install hetznerdns

Usage

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 ermilov.org
{'id': 'tfJ9nMJckFAV7LBghxWTNB', 'name': 'ermilov.org', 'ttl': 86400, 'registrar': '', 'legacy_dns_host': '', 'legacy_ns': ['oxygen.ns.hetzner.com.', 'helium.ns.hetzner.de.', 'hydrogen.ns.hetzner.com.'], 'ns': ['hydrogen.ns.hetzner.com', 'oxygen.ns.hetzner.com', 'helium.ns.hetzner.de'], '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 test-test-example.com
$ hetznerdns-cli zone get --name test-test-example.com
{'id': '5DFHAbGXmHX8ojKh6Prs8H', 'name': 'test-test-example.com', 'ttl': 3600, 'registrar': '', 'legacy_dns_host': '', 'legacy_ns': [], 'ns': ['hydrogen.ns.hetzner.com', 'oxygen.ns.hetzner.com', 'helium.ns.hetzner.de'], '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 test-test-example.com
$ hetznerdns-cli record create --name www --type A --value 127.0.0.1 --zone-name ermilov.org
{'record': {'id': '1ed054dbcc1b6445f10e5a86a6f9539b', 'type': 'A', 'name': 'www', 'value': '127.0.0.1', '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 ermilov.org
{'id': '1ed054dbcc1b6445f10e5a86a6f9539b', 'type': 'A', 'name': 'www', 'value': '127.0.0.1', '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 ermilov.org

Development

# Create virtual environment for python3
# Then inside the environment execute
git clone https://github.com/earthquakesan/hetznerdns-py && 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.5.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

hetznerdns-1.0.5-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file hetznerdns-1.0.5.tar.gz.

File metadata

  • Download URL: hetznerdns-1.0.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for hetznerdns-1.0.5.tar.gz
Algorithm Hash digest
SHA256 2a22a6767069099dbb4795aae4d34ce5c68d887bf0de36c645d6e31cc63ddbe9
MD5 4ddf3cdcc325075608e7df2919656803
BLAKE2b-256 28d48dc67074d41b38993d0311c7997d44890e1f4f2767dc83d83b14022ae2ad

See more details on using hashes here.

File details

Details for the file hetznerdns-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: hetznerdns-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5

File hashes

Hashes for hetznerdns-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e96dadc9817ba778eca771456a425db8f6ab455255fc83b665381d8af8d770c7
MD5 7f6559410550b5052ded01914b6f60b7
BLAKE2b-256 1c49585f27626bbc151d572a01cd835d6c66dd50227fa8a9d2d2f65cb8e109c9

See more details on using hashes here.

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