macOS · SwiftUI · Free & open source

Edit /etc/hosts
the way it deserves.

A native macOS app that turns hostname juggling into one-click environment switching — with a visual diff before every write and Touch ID-gated privileged edits.

Signed & notarized No Node or npm Reversible writes
The Hosts app window showing /etc/hosts entries grouped into System and Local Development, each row with an IP, hostname, and an enable toggle.
See it in action

A guided tour of the real app

From first-run onboarding to schemes, visual diffs, DNS flush, Touch ID unlock, and the custom theme editor.

Recorded from Hosts running on macOS · Midnight theme
Everything in one window

Stop hand-editing a root-owned text file

Hosts gives /etc/hosts the structured, reversible, validated editor it never had.

Named schemes

Save whole environments — Local dev, Staging, QA, Blocklist — and switch between them in one click. Duplicate, tag, and annotate them as you go.

Visual diff before write

See exactly which lines change before applying any scheme. Every switch snapshots the previous file first, so it's always reversible.

Backups & DNS flush

A timestamped backup is written before every change, and a one-click button flushes the macOS DNS cache so edits take effect immediately.

Toggle, don't delete

Flip any entry on or off without losing it — disabled lines stay in the file, commented out. IP and hostname validation catches typos before they land.

Search & duplicate detection

Filter by IP, hostname, or comment. Hosts flags any hostname that maps to more than one IP so conflicts never silently win.

History & undo

One-click revert to any earlier snapshot, Undo Last Change with ⌥⌘Z, automatic timestamped backups before every write, and a Flush DNS button.

Know what changes
before it changes.

Applying a scheme isn't a blind overwrite. Hosts shows a line-by-line diff of the exact additions and removals, optionally flushes the DNS cache, and snapshots the current file first.

  • Reversible by design — every apply is a restorable point in History.
  • Optional DNS flush after apply, right from the same sheet.
  • Read-only raw preview of the computed file, copyable to clipboard.
Hosts' Apply sheet showing a line-by-line diff before writing to /etc/hosts — one line added, zero removed, above the unchanged context lines, with a 'Flush DNS cache after applying' option.
A macOS Touch ID prompt over the Hosts window reading 'Hosts is trying to unlock Hosts for this session.'

Root access, on a short leash.

Writing /etc/hosts needs privilege — so Hosts does it through a signed LaunchDaemon helper registered with SMAppService, never by shelling out with sudo.

  • ECDSA-signed requests from a session key unlocked by Touch ID or an app PIN.
  • Replay protection — timestamps plus a persisted nonce set reject reused requests.
  • Hardened writes — symlink-safe atomic replace, size caps, control-character rejection.
  • Brute-force lockout that escalates after repeated wrong PIN attempts.
Make it yours

Eleven built-in themes, plus a custom editor

Per-token color overrides with live WCAG-contrast tuning, so every theme stays legible. Click any swatch to recolor this page — the same palettes ship in the app.

Pick a theme above — your choice is remembered on this device.

Hosts' custom theme editor: a live preview at the top, a base preset and seed accent, and per-token color overrides for surfaces, rows, text, and accents.
The built-in custom theme editor — override any token, with live contrast feedback.
One click, or about five minutes

Download the signed app — or build it yourself

The fastest path is the notarized .dmg above: drag to Applications and open, no build step, no Gatekeeper "unidentified developer" wall. Prefer to build from source? Open the project in Xcode (free) and sign it with your own free signing certificate — any Apple ID works, no paid Developer Program needed.

Prefer a one-click install? Download the signed .dmg.

A notarized disk image for drag-and-drop installation — no certificate, no build step. Or build from source below.

Download for macOS

downloads and counting

1

Create a free certificate

In Xcode → Settings → Accounts, sign in with any Apple ID to provision a free Apple Development certificate. No paid Developer Program needed.

2

Select your team

Open etc-hosts.xcodeproj and pick your team under Signing & Capabilities for both targets. Signing is automatic — Xcode uses your free certificate.

3

Build & unlock

Press ⌘R (or run xcodebuild) to compile and sign the app and helper, then enable the helper once in Login Items.

# 1. get the source git clone https://github.com/akar016012/hosts-app-macos.git cd hosts-app-macos # 2. build (Xcode signs with your team's certificate automatically) xcodebuild -project etc-hosts.xcodeproj -scheme etc-hosts -configuration Debug build # 3. run the built app (or just press ⌘R in Xcode) open HostsEditor.app

Full build & signing guide →

Give /etc/hosts a real editor.

Native SwiftUI. No web server, no browser UI, no npm. Free and open source under the AGPLv3.