From 4b222a2043ff2abc0edffe553700d5f1fe9519f7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 15 Nov 2026 21:30:02 -0700 Subject: 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) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6SwkivduFDDkMmnXjZ --- dns/primary.conf | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 dns/primary.conf (limited to 'dns/primary.conf') diff --git a/dns/primary.conf b/dns/primary.conf new file mode 100644 index 0000000..6aa1efb --- /dev/null +++ b/dns/primary.conf @@ -0,0 +1,58 @@ +# Knot DNS, hidden primary on cs, for the BIP-353 records (names/dns-update.js). +# Cloudflare's coinos.io zone delegates user._bitcoin-payment.coinos.io (and +# the staging one) here with NS + DS records; Knot signs the zones (DNSSEC) +# and the registrar changes them with TSIG-signed UPDATEs over the compose +# network. Nothing on the internet reaches this server: ovh2 runs the public +# secondary (dns/secondary.conf), notified and transferred over Tailscale. +# Keys (TSIG names-update and xfr) live in the state dir, never in git. +server: + listen: 0.0.0.0@53 + rundir: /rundir + +include: /keys/keys.conf + +remote: + - id: ovh2 + address: 100.120.75.121@53 + key: xfr + +acl: + - id: names_update + key: names-update + action: update + update-type: TXT + - id: xfr_ovh2 + key: xfr + action: transfer + +# The KSK never rolls on its own: its DS sits in Cloudflare by hand. +policy: + - id: ecdsa + algorithm: ecdsap256sha256 + ksk-lifetime: 0 + zsk-lifetime: 90d + nsec3: on + nsec3-iterations: 0 + nsec3-salt-length: 0 + +template: + - id: default + storage: /storage + file: "%s.zone" + dnssec-signing: on + dnssec-policy: ecdsa + serial-policy: unixtime + journal-content: all + zonefile-load: difference-no-serial + zonefile-sync: 60 + semantic-checks: on + notify: ovh2 + acl: [names_update, xfr_ovh2] + +log: + - target: stdout + any: info + +zone: + - domain: user._bitcoin-payment.coinos.io + - domain: user._bitcoin-payment.staging.coinos.io -- cgit v1.2.3