Skip to content

docs(prd): 0005 — a hosted Moshpit resolver, for devices that cannot run the bridge - #196

Merged
ralyodio merged 1 commit into
mainfrom
prd-hosted-resolver
Aug 1, 2026
Merged

docs(prd): 0005 — a hosted Moshpit resolver, for devices that cannot run the bridge#196
ralyodio merged 1 commit into
mainfrom
prd-hosted-resolver

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Draft PRD, no code. Follows the /pit/dns question: should resolution go to a Moshpit-run DNS server instead of a list on every machine?

The gap it addresses

A Moshpit ending isn't in the ICANN root, so nothing resolves it until the client is told something. Today there's exactly one way to be told — moshcode dns enable — and it's unavailable precisely where people meet a name:

  • a phone, which can't run a daemon or edit resolved.conf.d
  • a router, where you set a DNS server and nothing else
  • someone else's machine — the person you sent the link to

The fallback for all three is /n/<name>. It works, and it isn't resolution: the URL bar reads pit.moshcode.sh, so the name never becomes the visitor's address — which is the point of holding one.

What it is not

Not a replacement for the local bridge. Where a bridge can run it stays better: nobody else sees the queries, no round trip, no shared outage. This is for clients that can't run one, and the PRD says so in Goals, Non-Goals and R6.

The tradeoff, stated rather than solved

A hosted resolver sees every DNS query the device makes, not just Moshpit ones. That isn't fixable, only disclosed, and the PRD is written accordingly:

  • R3.3 — no query logging beyond aggregate counters. Flagged as the requirement that will come under pressure the first time someone asks "which endings are people looking up?" The honest answer is we can't know without becoming the thing the local bridge exists to avoid.
  • R3.2 — forwarded answers relayed unmodified. No injected records, no rewritten NXDOMAIN. A resolver that edits answers is spyware with a nice landing page.
  • R4/pit/dns must state the cost in the same visual weight as the addresses. A page listing an IP with no context gets pasted into a router by someone who hasn't thought about it.
  • R6 — never the default. Nothing silently points at it.

Risks section says outright that if the tradeoff is unacceptable, the honest outcome is to not ship this and leave /n/ as the answer for phones.

Two things worth knowing

The infrastructure is already half-built. MOSHPIT_DNS_RESOLVERS and MOSHPIT_DOH_URL are read, validated as real addresses, and rendered on /pit/dns — both unset in production. The shop window exists; the shop doesn't.

R5: reuse src/dns.mjs, don't fork it. The forwarding, the claimed-ending gate, the NODATA/NXDOMAIN distinction and AAAA support all exist and are tested (#195). A second implementation would drift — this codebase has already had that happen five times over with one regex.

Cheapest next step

Before building anything: measure how often /n/ is loaded from mobile user agents. If nobody is meeting Moshpit names on phones, this is infrastructure and abuse surface bought for an audience that isn't there.

Status is Draft deliberately — this is a decision to make, not a plan to execute.

🤖 Generated with Claude Code

…run the bridge

A Moshpit ending is not in the ICANN root, so nothing resolves it until
the client is told something. Today there is one way to be told, and it
is unavailable exactly where people meet a name: a phone cannot run a
daemon, a router takes a DNS server and nothing else, and the person you
sent the link to has installed nothing.

The fallback for all of them is /n/<name>, which works and is not
resolution — the URL bar reads pit.moshcode.sh, so the name never becomes
the visitor's address, which is the point of holding one.

Written as a draft rather than a plan because the central tradeoff is not
solvable, only disclosed: a hosted resolver sees every DNS query the
device makes, not just Moshpit ones. The PRD says so in the goals, in the
UI requirement, and in the risks, and states plainly that the honest
outcome may be to not ship it.

Deliberately not a replacement for the local bridge, which stays the
recommended path wherever it can run. The infrastructure is already
half-built — MOSHPIT_DNS_RESOLVERS and MOSHPIT_DOH_URL are read,
validated and rendered on /pit/dns, and both are unset in production.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 7da71c5 into main Aug 1, 2026
1 of 3 checks passed
@ralyodio
ralyodio deleted the prd-hosted-resolver branch August 1, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant