Hosts File Editor
When to use
Use this skill when:
- the user wants to open Dream resources by hostname in browser
- local
*.localtaudomains need to resolve on the current machine - curl tests should avoid manual
Hostheaders
Inputs
- One or more FQDNs (for example
abc123.default.localtau) - Target IP (default
127.0.0.1for Dream local) - OS (
windows,linux, ormacos)
Hosts file paths
- Windows:
C:\Windows\System32\drivers\etc\hosts - Linux/macOS:
/etc/hosts
Procedure
- Validate each FQDN before writing:
- non-empty - no scheme/path/port - no duplicates
- Read current hosts file.
- Ensure a section marker exists:
- # Taubyte Local Domains
- For each FQDN, ensure exactly one mapping line:
- 127.0.0.1 <fqdn>
- If an entry exists with a different IP, update it to target IP.
- Preserve unrelated lines and comments.
- Write changes with elevated permissions.
- If elevation fails, provide exact manual steps and content to append.
Automation policy
- Always attempt automatic update first (idempotent write, no duplicates).
- On Windows, try elevated write path first; if blocked, switch to manual fallback immediately with exact lines.
- After update attempt (success or fallback), run verification curl checks so execution can continue.
Safety rules
- Never remove unrelated host mappings.
- Never add URL prefixes such as
http://orhttps://. - Never include ports/paths in hosts file lines.
- Prefer idempotent updates (re-running should not duplicate entries).
Verification
Run at least one check after edits:
curl "http://<fqdn>:<port>/"Or verify direct routing without hosts dependency:
curl --resolve "<fqdn>:<port>:127.0.0.1" "http://<fqdn>:<port>/"If using browser, open:
http://<fqdn>:<port>/Windows manual fallback (if no elevation)
- Open Notepad as Administrator.
- Open
C:\Windows\System32\drivers\etc\hosts(All Files filter). - Append:
- # Taubyte Local Domains - 127.0.0.1 <fqdn> - (repeat one line per FQDN)
- Save.