toolkit hosts command group lets you add, remove, and inspect custom domain-to-IP mappings in your system hosts file. Unlike tools that write directly into the body of the file, Toolkit uses a labeled isolation block to contain every entry it manages. Your existing hosts file content is never touched — Toolkit’s entries live inside a clearly delimited section that you can inspect at any time, and the block is removed cleanly when all managed entries are gone.
toolkit hosts list
Lists all domain entries currently managed by Toolkit, along with a count of unmanaged system entries that exist outside the block. Syntax
Examples
toolkit hosts add
Adds a domain-to-IP mapping inside the Toolkit-managed block of your system hosts file. If the domain already exists in the managed block, the entry is updated. The rest of your hosts file is not modified. Syntax
Options
Examples
toolkit hosts remove
Removes a managed domain from the Toolkit isolation block in your system hosts file. If no managed entries remain after the removal, Toolkit cleans up the block entirely. Syntax
Options
Examples
Isolation mechanism
Toolkit never edits the native content of your hosts file. Instead, it inserts a self-contained block delimited by two marker comments. Everything outside this block remains exactly as you left it. After runningtoolkit hosts add my-app.local and toolkit hosts add api.local 192.168.1.50, your hosts file will contain a section that looks like this: