Skip to main content

Crate mist

Crate mist 

Source
Expand description

§Mist: Private DNS for Local-First Networking

Mist gives Land its own private DNS so editor components can find each other on *.editor.land without touching the public internet. All queries resolve to 127.0.0.1. No external DNS leaks, no configuration needed.

§Features

  • Private DNS Zone: Authoritative zone for *.editor.land domains
  • Local Resolution: All editor.land queries resolve to 127.0.0.1.
  • Dynamic Port Allocation: Automatically finds available ports using portpicker
  • Async/Sync Support: Both async and blocking server implementations

§Example

use Mist::start;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
	// Start the DNS server (tries port 5353 first, then finds an available one)
	let port = start(5353)?;

	println!("DNS server running on port {}", port);

	// The server runs in the background
	// Use DNS_PORT to get the port number elsewhere

	Ok(())
}

Modules§

ForwardSecurity
DNS Forward Security
Resolver
DNS Resolver
Server
DNS Server
Zone
DNS Zone

Statics§

DNS_PORT
Global DNS port number.

Functions§

dns_port
Returns the DNS port number.
start
Starts the DNS server for the CodeEditorLand private network.