LocalDNS.wtf
CLI Reference

Domain Management

Commands for adding, removing, and listing local domain mappings.

Domain Management

localdns add

Add a new local domain mapping.

localdns add <domain> [options]

Arguments

ArgumentRequiredDescription
domainYesLocal domain name (must end with .local)

Options

OptionDescription
-c, --cmd <command>Command to run the app (e.g. "npm start")
-p, --port <port>Fixed port number (default: auto-assign 7100-7899)
-u, --url <url>Proxy to a remote URL instead of running a local command
--env <vars>Environment variables, comma-separated KEY=value pairs
--startup <policy>Startup policy: always | lazy | manual | on-demand
--service-type <type>Service type: app | api | database | cache | queue | worker | proxy | monitoring | other
--restart <policy>Restart policy: always | on-failure | never
--alias <aliases>Comma-separated alias domains
--mode <mode>Run mode: dev | production
--dev-cmd <command>Development mode command
--prod-cmd <command>Production mode start command
--build-cmd <command>Production mode build command
--idle-timeout <seconds>Idle timeout before dormancy (default: 300)
--cwd <directory>Working directory for the process

Examples

localdns add myapp.local --cmd "npm start"
localdns add api.local --cmd "node server.js" --port 8080
localdns add app.local --cmd "npm start" --env "NODE_ENV=dev,API_KEY=secret"
localdns add staging.local --url "https://staging.myapp.com"
localdns add dashboard.local --cmd "pnpm dev" --startup lazy --alias dash.local

localdns remove

Remove a domain mapping. Stops the process if running, removes from registry and /etc/hosts.

localdns remove [domain] [options]

Aliases: rm

OptionDescription
-f, --forceSkip confirmation prompt
localdns remove myapp.local
localdns rm myapp.local --force

localdns list

List all registered domains with status, port, and command.

localdns list [options]

Aliases: ls

OptionDescription
--jsonOutput as JSON (for piping to other tools or AI agents)
localdns list
localdns ls --json

localdns open

Open a project in editor or browser. Searches indexed projects with fuzzy matching.

localdns open [query] [options]
OptionDescription
-e, --editor <editor>Editor command (default: auto-detect)
--registerRegister the project with LocalDNS after opening
localdns open myapp
localdns open myapp --register