Developer & Data
Hosts & Environment
Hosts & Environment edits /etc/hosts as entries, groups and named profiles. Every write shows the exact diff, keeps a backup and asks for an administrator. It also shows the variables your shell and apps get, and keeps yours in one marked block of the shell startup file.
Install Hosts & Environment
- Open Library in Edith's sidebar.
- Search for Hosts & Environment in Search tools, or open the Developer & Data category.
- Press Install. Hosts & Environment is added to your sidebar.
From the terminal, ed extensions install hostsEditor does the same. See Extensions for turning extensions off, updating and removing them.
Where to find Hosts & Environment
- Sidebar. Click Hosts & Environment in the sidebar to open its page, or press ⌘K and type its name.
- Home. Open Home, press Edit Home, then Add widgets to place its widgets.
Get started with Hosts & Environment
- Review the hosts file. Entries are grouped as the file groups them. Turn one off to comment it out, or add and edit entries with checked addresses and host names.
- Switch a profile. A profile is a named set of entries, such as Staging. Turning it on adds its block to the hosts file; turning it off comments the block out.
- Write with a diff. Edith shows the exact change, keeps a backup of the previous file, asks for an administrator, then clears the DNS cache.
- Set environment variables. Variables you add go into one block marked as Edith's in your shell startup file. Lines outside it are never changed.
What Hosts & Environment does
- Edit the hosts file. Turn /etc/hosts entries on and off, and add, edit and delete them with validation.
- Hosts profiles. Switch named sets of hosts entries, such as Staging or Block distractions.
- Environment variables. See login shell and app variables and keep your own in a marked block of the shell startup file.
Settings
Open Hosts & Environment from the sidebar and press Settings at the top right of its page. You can also select Hosts & Environment in Library and press Settings, or press ⌥⌘, while its page is open.
From the terminal, read a setting with ed config get <key> and change it with ed config set <key> <value>, using the key in the last column. See ed config.
Writing the hosts file
| Setting | Default | Values | Key |
|---|---|---|---|
| Clear the DNS cache after writing Apps see the new hosts entries at once instead of after the cache expires. |
On | On, Off | hostsEditorFlushDNS |
Environment
| Setting | Default | Values | Key |
|---|---|---|---|
| Show values of keys and tokens Values of variables whose names look like keys, tokens or passwords are hidden until you turn this on. |
Off | On, Off | hostsEditorRevealValues |
From the terminal
Everything above works in the app. The ed command line is optional, for scripts and coding agents. Hosts & Environment's commands are in ed hosts-editor, and each one is also a tool in Edith's MCP server.
Permissions and requirements
- macOS 14 or later on Apple silicon