A native macOS menu bar app for managing /etc/hosts.
- Menu Bar App — Lives in the macOS menu bar, always one click away
- Hosts Editor — Full text editor with syntax highlighting (IPs in blue, comments in gray, invalid lines underlined in red)
- Config Management — Organize entries into named configs, toggle them on/off independently
- Group Support — Bundle multiple configs into groups for batch toggling
- Quick Toggle — Enable/disable configs and groups directly from the menu bar popover
- Snapshot History — Automatic snapshots of config changes with one-click restore
- Privileged Helper — Secure write to
/etc/hostsvia XPC with caller verification - Widget — WidgetKit extension for quick toggles from the desktop
- Validation — Real-time hosts format validation before applying changes
- macOS 26.0+
- Xcode 26+
- XcodeGen
Download the latest release from GitHub Releases, unzip, and move OpenHosts.app to /Applications.
# Install XcodeGen if needed
brew install xcodegen
# Clone the repository
git clone https://github.com/debuginn/OpenHosts.git
cd OpenHosts
# Generate Xcode project
xcodegen generate
# Build
xcodebuild build -scheme OpenHosts -configuration Release
# Run tests
xcodebuild test -scheme SharedKitTests -destination 'platform=macOS'Or open OpenHosts.xcodeproj in Xcode and build from there.
- Launch OpenHosts — it appears in the menu bar
- Click the menu bar icon to open the popover
- Click OpenHosts to open the editor window
- Create configs with the + button, write your hosts entries
- Toggle configs on/off — changes are applied to
/etc/hostsautomatically - Use groups to organize and batch-toggle related configs
The privileged helper requires one-time approval in System Settings > General > Login Items & Extensions.
OpenHosts (Main App)
├── Menu Bar Popover — quick toggle UI
├── Editor Window — full hosts editor with syntax highlighting
├── Settings Window — preferences (General + About tabs)
└── AppViewModel — central state management
OpenHostsHelper (Privileged Daemon)
└── XPC Service — writes /etc/hosts atomically, validates caller via proc_pidpath()
OpenHostsWidget (WidgetKit Extension)
└── Toggle configs from desktop widgets
SharedKit (SPM Package)
├── HostsComposer — assembles /etc/hosts content with managed section boundaries
├── HostsGroup — group data model
└── HostsParser — text parsing utilities
The app manages a section in /etc/hosts between # --- OPENHOSTS_START --- and # --- OPENHOSTS_END --- markers, preserving all content outside those boundaries.
Contributions are welcome! Please open an issue or submit a pull request.

