Multi-provider DNS management for alternatefutures.ai using OctoDNS.
┌─────────────────────────────────────────────────────────────┐
│ REGISTRAR (Namecheap) │
│ NS: Cloudflare (primary, active) │
└─────────────────────────────────────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌──────────┐ ┌──────────┐
│Cloudflare│ │ deSEC │
│ (active)│ │(standby) │
└──────────┘ └──────────┘
│ │
└───────────────┬───────────────┘
│
┌─────────┴─────────┐
│ OctoDNS │
│ (record sync) │
└───────────────────┘
If Cloudflare goes down, you can quickly switch to deSEC by changing NS at your registrar. Records are already synced and ready.
| Provider | Status | Role |
|---|---|---|
| Cloudflare | Active (NS at registrar) | Primary, serving traffic |
| deSEC | Standby (records synced) | Backup, ready to serve |
octodns.yaml- OctoDNS configuration (Cloudflare + deSEC)zones/alternatefutures.ai.yaml- DNS records (source of truth).github/workflows/dns-sync.yml- Syncs records to all providers on push.github/workflows/dns-monitor.yml- Monitors health every 5 minutes
- Edit
zones/alternatefutures.ai.yaml - Push to main branch
- GitHub Actions syncs to both Cloudflare and deSEC
# Install
pip install -r requirements.txt
# Validate
export CLOUDFLARE_API_TOKEN="..."
export DESEC_API_TOKEN="..."
octodns-validate --config=octodns.yaml
# Dry run
octodns-sync --config=octodns.yaml --doit=false
# Apply
octodns-sync --config=octodns.yaml --doitSet these in GitHub repository secrets:
| Secret | Description |
|---|---|
CLOUDFLARE_API_TOKEN |
Cloudflare API token with Zone:DNS:Edit + Zone:Page Rules:Read |
DESEC_API_TOKEN |
deSEC API token |
- Zone:
alternatefutures.ai(active) - NS:
jeremy.ns.cloudflare.com,miki.ns.cloudflare.com - Token requires: Zone:Zone:Read, Zone:DNS:Edit, Zone:Page Rules:Read
- Zone:
alternatefutures.ai(standby) - NS:
ns1.desec.io,ns2.desec.org - Minimum TTL: 3600 seconds (1 hour)
- Docs: https://desec.readthedocs.io/
If Cloudflare is down:
- Log into Namecheap (registrar)
- Go to Domain → Nameservers
- Change NS to:
ns1.desec.io,ns2.desec.org - Wait for propagation (5-60 minutes)
To switch back to Cloudflare:
- Change NS to:
jeremy.ns.cloudflare.com,miki.ns.cloudflare.com
The dns-monitor.yml workflow runs every 5 minutes:
- Queries each provider's nameserver directly
- Creates GitHub issue with
dns-alertlabel if providers are down - Shows health status in workflow summary
- TTL is set to 3600 seconds to satisfy deSEC's minimum requirement
- Zone file keys must be alphabetically sorted (
enforce_order: true) - OctoDNS loads all providers at startup, so both tokens must be set even when targeting one provider