diff options
| author | Adam Soltys <[email protected]> | 2026-11-15 21:30:02 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-15 21:30:02 -0700 |
| commit | 4b222a2043ff2abc0edffe553700d5f1fe9519f7 (patch) | |
| tree | 89ca531b3ce85480f2b09d065b3f319aeba6c9e9 /dns/README.md | |
| parent | 4aa5606408f7188a7edda5c010793f9d7d1dc076 (diff) | |
| download | coinosv3-server-4b222a2043ff2abc0edffe553700d5f1fe9519f7.tar.gz coinosv3-server-4b222a2043ff2abc0edffe553700d5f1fe9519f7.zip | |
BIP-353 records move to our own DNS: Knot on cs, served from ovh2. "just learned cloudflare may have a quota on how many names we can register on dns so is that going to foil our plans to give everyone a bip353 payment address?" … "yeah build it on cs don't worry about the fallback just get it working with our knot dns" (Adam, 2026-11-16). coinos.io's Cloudflare zone (Pro) was at 3,038 of its 3,500 records with one TXT per name and about 35 names claimed a day. user._bitcoin-payment.coinos.io and user._bitcoin-payment.staging.coinos.io get delegated (NS + DS in Cloudflare) to Knot DNS, so there's no record quota. The `dns` compose service on cs is the hidden primary: it signs both zones (ECDSA P-256, NSEC3 without iterations, the KSK fixed because its DS sits in Cloudflare) and listens on cs's Tailscale address only, because the house router forwards nothing to cs. ovh2 runs the public secondary (dns/secondary.conf, dns1.coinos.io), notified and transferred over Tailscale with a TSIG key, so names keep resolving while cs is down. The registrar sends RFC 2136 UPDATEs signed with TSIG hmac-sha256 over TCP (names/dns-update.js) for domains with `knot` in its config. It replaces a name's TXT RRset whole, removes it on release and on account deletion (forgetAccount now hands back the name), and deletes a name's leftover Cloudflare record as it rewrites it. names/dns-migrate.js does the one-shot moves: backfill, check, cf-cleanup. dns/README.md is the runbook. Tested against Knot 3.4.11: updates land signed, a 700-byte URI spans several TXT strings, a wrong key gets NOTAUTH and an out-of-zone name gets NOTZONE. bun test names/ passes (21, with the new dns-update tests)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6SwkivduFDDkMmnXjZ
Diffstat (limited to 'dns/README.md')
| -rw-r--r-- | dns/README.md | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/dns/README.md b/dns/README.md new file mode 100644 index 0000000..f730ff8 --- /dev/null +++ b/dns/README.md @@ -0,0 +1,57 @@ +# BIP-353 DNS (Knot) + +`₿[email protected]` resolves through a DNSSEC-signed TXT record at +`name.user._bitcoin-payment.coinos.io`. Cloudflare caps a zone at 3,500 records +(Pro), and one record per name had coinos.io at 3,038 on 2026-11-16, so the +per-name records live on our own Knot DNS instead: + +``` +Cloudflare (coinos.io zone, DNSSEC) + dns1.coinos.io A 51.79.52.200 (DNS only) + user._bitcoin-payment.coinos.io NS dns1.coinos.io + DS (the zone's KSK) + user._bitcoin-payment.staging.coinos.io NS dns1.coinos.io + DS + │ +ovh2 knot-bip353 public secondary, answers the internet (secondary.conf) + │ NOTIFY / AXFR+IXFR over Tailscale, TSIG key `xfr` +cs dns hidden primary, signs the zones (primary.conf, compose `dns`) + │ RFC 2136 UPDATE over the compose network, TSIG key `names-update` +cs names the registrar (names/dns-update.js), domains with `knot` in its config +``` + +## cs (primary) + +- State: `$STATE/dns/keys.conf` (both TSIG keys, `key:` list) and + `$STATE/dns/storage/` (zone files, journal, DNSSEC keys — back it up; losing + the KSK means a new DS in Cloudflare). +- The compose service publishes port 53 on cs's Tailscale address only. +- `docker exec dns knotc zone-status`, `docker exec dns kdig @127.0.0.1 TXT adam.user._bitcoin-payment.coinos.io`. +- DS for Cloudflare: `docker exec dns keymgr user._bitcoin-payment.coinos.io ds` (the SHA-256 line). +- The KSK never rolls by itself (`ksk-lifetime: 0`); ZSKs roll every 90 days + without anyone's help. + +## names config + +```json +"coinos.io": { "zoneId": "…", "knot": { "zone": "user._bitcoin-payment.coinos.io", "server": "dns", "port": 53, + "key": { "name": "names-update", "secret": "<base64 from keys.conf>" } } } +``` + +One-shot moves (`names/dns-migrate.js`, inside the names container): +`backfill` (every name → Knot), `check` (Knot matches the database), +`cf-cleanup` (delete the per-name TXT records from Cloudflare). + +## ovh2 (public secondary) + +Installed by hand (ovh2 has no deploy hook): + +``` +/etc/knot-bip353/knot.conf = dns/secondary.conf +/etc/knot-bip353/keys.conf = the `xfr` key only +/var/lib/knot-bip353/ storage +docker run -d --name knot-bip353 --network host --restart unless-stopped \ + -v /etc/knot-bip353/knot.conf:/config/knot.conf:ro -v /etc/knot-bip353/keys.conf:/keys/keys.conf:ro \ + -v /var/lib/knot-bip353:/storage cznic/knot:3.4 knotd -c /config/knot.conf +ufw allow 53/udp; ufw allow 53/tcp +``` + +A config change there: copy the file over, `docker restart knot-bip353`. |
