Metadata-Version: 2.4
Name: octodns-hetzner
Version: 3.0.0
Summary: Hetzner DNS provider for octoDNS
Author-email: Ross McFarland <rwmcfa1@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/octodns/octodns-hetzner
Project-URL: Source, https://github.com/octodns/octodns-hetzner
Project-URL: Issues, https://github.com/octodns/octodns-hetzner/issues
Keywords: dns,octodns,dns-as-code
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: System :: Systems Administration
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: octodns>=1.5.0
Requires-Dist: hcloud>=2.3.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-network; extra == "test"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-network; extra == "dev"
Requires-Dist: black<27.0.0,>=26.0.0; extra == "dev"
Requires-Dist: build>=0.7.0; extra == "dev"
Requires-Dist: changelet; extra == "dev"
Requires-Dist: isort>=5.11.5; extra == "dev"
Requires-Dist: proviso; extra == "dev"
Requires-Dist: pyflakes>=2.2.0; extra == "dev"
Requires-Dist: readme_renderer[md]>=26.0; extra == "dev"
Requires-Dist: twine>=3.4.2; extra == "dev"
Dynamic: license-file

## Hetzner DNS provider for octoDNS

An [octoDNS](https://github.com/octodns/octodns/) provider that targets [Hetzner DNS](https://docs.hetzner.com/networking/dns/).

### Installation

#### Command line

```
pip install octodns-hetzner
```

#### requirements.txt/setup.py

Pin specific versions or SHAs in your project to control upgrades. Refer to
PyPI for current releases. Minimum requirements align with `setup.py`, e.g.:

```
octodns>=1.5.0
octodns-hetzner>=1.0.0
```

### Configuration

```yaml
providers:
  hetzner:
    class: octodns_hetzner.HetznerProvider
    # Your Hetzner Cloud API token (required)
    token: env/HETZNER_TOKEN
```

The provider uses the Hetzner Cloud API through the official `hcloud` client,
which is installed as a dependency of this package. Create the token in the
[Hetzner Console](https://console.hetzner.com/). When zone or RRSet TTLs are
unavailable from the API, the provider uses a fallback of `3600` seconds.

### Migrating from 2.x

Hetzner shut down the legacy DNS Console API (`dns.hetzner.com`) in May 2026,
and version 3.0 removes the `dnsapi` backend that used it. To upgrade:

1. Replace the DNS Console token with a Hetzner Cloud API token. The two token
   types aren't interchangeable, so an old DNS Console token fails with an
   authentication error.
2. Remove `backend: dnsapi` from your provider configuration. The provider
   raises an error at startup if it's still set. `backend: hcloud` is still
   accepted, so configurations that already set it keep working.
3. Run `octodns-sync` without `--doit` and confirm the plan shows no unexpected
   changes.

### Support Information

#### Records

HetznerProvider supports A, AAAA, CAA, CNAME, DS, MX, NS, PTR, SRV, TLSA, and TXT

#### TXT Records and DKIM

Long TXT records (such as DKIM keys exceeding 255 characters) are automatically
chunked into RFC-compliant format. For DKIM keys, configure them as a single TXT
value in your zone file:

```yaml
dkim._domainkey:
  type: TXT
  value: "v=DKIM1\\;k=rsa\\;p=MIIBIjANBgkqh...very-long-key..."
```

The provider will automatically split values exceeding 255 characters into
properly quoted chunks (e.g., `"chunk1" "chunk2"`). Do not manually split long
values into multiple `values:` entries unless you specifically need multiple
distinct TXT records (such as for site verification).

#### Root NS Records

HetznerProvider supports full root NS record management.

#### Dynamic

HetznerProvider does not support dynamic records.

### Development

See the [/script/](/script/) directory for some tools to help with the development process. They generally follow the [Script to rule them all](https://github.com/github/scripts-to-rule-them-all) pattern. Most useful is `./script/bootstrap` which will create a venv and install both the runtime and development related requirements. It will also hook up a pre-commit hook that covers most of what's run by CI.
