Mist runs an authoritative Hickory DNS server for the editor.land zone,
binding exclusively on 127.0.0.1 so that every *.editor.land subdomain
resolves to 127.0.0.1 instead of reaching the public internet. It acts as a
network policy enforcement point: sidecar processes such as Cocoon and Air can
only resolve domains that appear on an explicit allowlist, and every other
external query receives NXDOMAIN. The zone is signed with ECDSA P-256 keys so
that DNSSEC-aware clients can verify the authenticity of every response.
Why DNS isolation
VS Code extensions run arbitrary code. Without a network boundary a compromised
or buggy extension can resolve any hostname and exfiltrate data through DNS.
Mist closes that vector by becoming the sole resolver that Cocoon and Air are
allowed to use. Those processes are spawned with a DNS override pointing to
127.0.0.1:5380, so extension code cannot bypass the server regardless of which
port it attempts to use for its own UDP traffic.
DNS isolation also means that *.editor.land names never leave the machine.
gRPC addresses like cocoon.editor.land are private implementation details
that resolve only within the running editor process.
Architecture
Mist is organised into five core modules:
Module Map
| Path | Purpose |
|---|---|
Source/Server.rs |
UDP and TCP DNS listener, query dispatch |
Source/Zone.rs |
editor.land zone configuration and record generation |
Source/Resolver.rs |
LandDnsResolver - DNS client pointed at the local server for consumers |
Source/ForwardSecurity.rs |
The forward allowlist - DefaultForwardAllowlist() and the refusal path |
Source/WebSocket.rs |
JSON-RPC over WebSocket for the Sky↔Cocoon direct path |
Source/Library.rs |
Library root: start(port), dns_port(), module re-exports |
Hickory DNS
Mist is built on Hickory DNS (formerly Trust-DNS), a pure-Rust async DNS library. The server exposes both UDP and TCP listeners on port 5380. All query handling runs on Tokio so no thread is ever blocked waiting for I/O.
| Dependency | Version | Role |
|---|---|---|
hickory-server |
0.26.1 | DNS server and catalog management |
hickory-proto |
0.26.1 | Wire-protocol encoding and decoding |
hickory-client |
0.25.2 | DNS client for the forwarding resolver path |
ring |
0.17.14 | ECDSA P-256 key generation and signing |
tokio |
1.52.3 | Async runtime |
The versions are the workspace’s, declared once in the root Cargo.toml; the
element takes them with workspace = true and pins nothing of its own.
Zone configuration
The authoritative zone covers editor.land and all subdomains. The SOA
record is generated in memory at startup; no zone file on disk is required.
editor.land. IN SOA localhost. root.editor.land. (
2026010100 ; serial
3600 ; refresh
900 ; retry
86400 ; expire
60 ; minimum TTL
)
*.editor.land. IN A 127.0.0.1
All *.editor.land subdomains resolve to 127.0.0.1:
- Ensures sidecar processes communicate only over localhost
- Prevents any sidecar process from exfiltrating data through DNS
- Provides a first line of defence against compromised extension code
Resolution Rules
| Query Pattern | Response | Behavior |
|---|---|---|
*.editor.land |
A 127.0.0.1 |
Authoritative answer from zone |
| Allowlisted domain | Forward to upstream DNS | Pass-through to system resolver |
| All other domains | REFUSED |
Refused, not “does not exist” |
The distinction matters: an unlisted host is refused rather than reported as
NXDOMAIN, because NXDOMAIN would claim the name does not exist while the
truth is that this resolver will not answer for it.
Forward allowlist
External queries are forwarded to the upstream resolver only for domains that
appear in the allowlist. ForwardSecurity::DefaultForwardAllowlist() authorizes
exactly one domain today:
| Domain | Purpose | Status |
|---|---|---|
update.editor.land |
Application update server | Allowlisted |
| All unlisted domains | - | REFUSED response |
The list is a compiled default in Source/ForwardSecurity.rs, not a runtime
setting - adding a domain is a source change and a rebuild, and there is no
hot-reload path for it.
Important
The allowlist is the complete set of external hosts that all extensions can contact. Adding a domain grants network access to every extension, not only one. Treat allowlist changes as a security-sensitive operation.
DNSSEC
The zone is signed with ECDSA P-256 (algorithm 13). On first run Mist generates a key pair and writes it to the application data directory. Subsequent starts load the cached keys and sign all zone records before the server begins accepting queries.
| Aspect | Detail |
|---|---|
| Algorithm | ECDSA P-256 (algorithm 13) |
| Key generation | Automatic on first run, persisted to app data directory |
| RRSIG records | Generated in memory on zone load |
| Validation | N/A (authoritative server) |
WebSocket Transport
Mist also carries a local JSON-RPC-over-WebSocket transport,
Source/WebSocket.rs, for a direct Sky→Cocoon path. The point is to
remove the Tauri-invoke + Mountain-gRPC double hop on extension-API traffic,
which is the large majority of IPC volume in an interactive session - not to
shave a fixed number of milliseconds off each call.
| Aspect | Detail |
|---|---|
| Port | 5051 - Mist::WebSocket::ServeLocal(5051, secret, registry) |
| Wire format | Text frames carrying {"id","method","params"} / {"id","result"} / {"id","error"}; id: null marks a notification |
| Auth | Per-spawn 32-byte shared secret, sent as the X-Land-Secret upgrade header or a ?secret=<hex> query parameter |
| Handlers | A HandlerRegistry the host populates before serving |
| Binary | Reserved for a later phase; the current implementation logs and ignores binary frames |
Mountain creates the registry and the secret in Binary/Main/Entry.rs and
serves the socket alongside the DNS listener.
Integration with Mountain
Mountain calls Mist::start(5380) during application initialisation and
receives the bound port as its return value. That value becomes the DnsPort
managed Tauri state and is exposed to the workbench through a set of DNS
commands - dns_resolve, dns_health_check, dns_get_server_info,
dns_get_zone_info and dns_get_forward_allowlist - so the UI can report what
the resolver is doing without a second client implementation.
- Air configures its
LandDnsResolverfrom Mist’s resolvers, so all outbound HTTP requests from the background daemon pass through the same policy enforcement point. - Cocoon and SideCar are the intended consumers of the same resolver. Mountain’s process management does not currently set a DNS override in either child’s environment, so treat the sidecar-side enforcement as wiring that exists on the Air path and is still being extended to the other two.
Startup Sequence
1. Mountain starts Mist from Binary/Main/Entry.rs
- Mist::start(5380); if that errors, Mountain retries with Mist::start(0)
and lets portpicker choose an ephemeral port
- The bound port is stored in Mountain's DnsPort managed state
2. Mist binds the socket before reporting success
- UDP + TCP listeners on 127.0.0.1
- start() blocks on the detached task's port report, so it can never
advertise a port no server actually owns
- A second start() is refused outright rather than racing the first
3. The editor.land zone and DNSSEC keys load
- Hickory DNS server initialises
- DNSSEC signing keys are loaded, or generated on first run
4. DNS resolution begins
- *.editor.land queries answered authoritatively
- update.editor.land forwarded to the system resolver
- All other domains return REFUSED
5. The WebSocket transport starts (optional)
- Mist::WebSocket::ServeLocal(5051, secret, registry)
- Accepts the Sky -> Cocoon direct path
Usage
// Start on preferred port 5380
let port = Mist::start(5380)?;
println!("DNS server running on 127.0.0.1:{}", port);
// Build a resolver for use in HTTP clients
let resolver = Mist::resolver::land_resolver(Mist::dns_port());
Related Documentation
The record this page documents, as the site files it: the six facts the claim is checked against, and the three files the manual names to check it.
WORKING, 06
- FORM:
- DNS SANDBOX
- WRITTEN IN:
- RUST
- BOUNDARY:
- LOOPBACK SOCKET
- DEPENDS ON:
- MOUNTAIN
- MANUAL:
- /DOC/DEEP-DIVE-MIST
- EVIDENCE:
- UNAVAILABLE NO MANIFEST IN THE BUILD
# TRACE / MIST 03 STEPS
- 01
Source/Resolver.rsTHE RESOLVER - 02
Source/Server.rsTHE LOOPBACK SERVER - 03
Source/ForwardSecurity.rsTHE ALLOWLIST
SOURCE: /DOC/DEEP-DIVE-MIST