DNS-as-code for tjdev.club. We keep our DNS records in YAML and deploy them to Cloudflare with OctoDNS.
- Zone config: Per-website-group YAML files live under
club_sites/anduser_sites/. A small build step merges them intozones/tjdev.club.yamlfor OctoDNS. - Deploy: GitHub Actions runs OctoDNS on pushes to
mainand applies changes to Cloudflare. - Scripts:
scripts/deploy_dns.sh(apply) andscripts/dump_dns.sh(export current zone). Both require Cloudflare creds. - Env: Python 3.12 with
uv. Deps are OctoDNS and the Cloudflare provider (seepyproject.toml).
- We define records in YAML by group. Place one file per website group inside
club_sites/oruser_sites/(e.g.,club_sites/purelymail.yaml,club_sites/www.yaml). uv run python ./merge_zones.pymerges all YAML intozones/tjdev.club.yaml.- CI runs:
octodns-sync --config-file=config/production.yaml --doitto push changes using the merged zone. - You don’t need Cloudflare access to propose changes; CI handles the deploy after merge.
- Pick a subdomain (example:
jimmy.tjdev.club). - Create a new file in
user_sites/named after your group (e.g.,user_sites/jimmy.yaml) with:
---
jimmy:
ttl: 300
type: CNAME
value: user.tjhsst.edu.Important
When using FQDNs (like user.tjhsst.edu.), include the trailing dot. This tells DNS it's a fully qualified domain name, not relative to the current zone.
- Fork this repository and make a branch with your change (usually a new or updated file under
user_sites/). - Keep the diff small and explain the “why” in the PR description.
- For shared/club records, mention an owner/contact.
- Avoid apex/root changes unless you're working on a club site!
- Install
uv, then:
uv sync
uv run octodns-sync --config-file=config/production.yaml --help- To export the current Cloudflare zone to files (requires secrets):
./scripts/dump_dns.sh - To deploy from local (requires secrets):
./scripts/deploy_dns.sh
Questions? Open an issue or ask in the club Discord.