DNS-as-code for jscraftcamp.org using OctoDNS with the Hetzner provider.
- Python 3.12+
- A Hetzner DNS Console API token (dns.hetzner.com)
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtCopy the environment template and fill in your token:
cp .env.example .env
# edit .env with your actual tokenDry-run (preview changes without applying):
source .env
octodns-sync --config-file=octodns.yamlApply (push changes to Hetzner DNS):
source .env
octodns-sync --config-file=octodns.yaml --doitIf the zone already has records in Hetzner, dump them first to avoid deleting anything on the initial sync:
octodns-dump --config-file=octodns.yaml --output-dir=zones/ jscraftcamp.org. hetznerReview zones/jscraftcamp.org.yaml, then commit the result.
GitHub Actions runs automatically:
| Trigger | Behaviour |
|---|---|
| Pull request | octodns-sync dry-run (plan only) |
Push to main |
octodns-sync --doit (apply) |
The workflow requires a repository secret named HETZNER_TOKEN.
.
├── octodns.yaml # OctoDNS configuration
├── zones/
│ └── jscraftcamp.org.yaml # DNS records for jscraftcamp.org
├── requirements.txt # Python dependencies
└── .github/workflows/
└── octodns.yaml # CI/CD workflow