Skip to content

Modern, profile-based hosts file manager for macOS. Block ads, trackers, and distractions with ease.

License

Notifications You must be signed in to change notification settings

sane-apps/SaneHosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

SaneHosts

Modern hosts file manager for macOS

GitHub stars License: GPL v3 macOS 14+ Swift 6.1

⭐ Star this repo if it's useful! · 💰 Buy for $5 · Keeps development alive

SaneHosts is a native macOS app that makes managing your /etc/hosts file simple and intuitive. Choose a protection level, activate it, done. No Terminal. No commands. If something breaks, just deactivate.

Features

Protection Levels

Choose from 5 curated protection levels - each bundles the right blocklists for your needs:

Level What It Blocks
Essentials Ads, trackers, malware - the basics everyone needs
Balanced Essentials + phishing, fraud, aggressive tracking
Strict Balanced + social media trackers, native telemetry
Aggressive Strict + gambling, piracy, adult content
Kitchen Sink Everything available - maximum blocking

Core Features

  • Profile Management - Create and manage multiple hosts configurations with color tagging
  • 200+ Curated Blocklists - Import from Steven Black, Hagezi, AdGuard, OISD, and 10+ categories. SaneHosts is an officially listed tool in the upstream StevenBlack/hosts repository.
  • Guided Setup - Coach mark tutorial walks you through activation on first launch
  • Remote Import - Import hosts from any URL or paste custom blocklist URLs
  • Merge Profiles - Combine multiple profiles with automatic deduplication
  • Automatic DNS Flush - DNS cache cleared when activating profiles
  • Menu Bar Access - Quick profile switching from the menu bar
  • Crash Resilient - Automatic backups (3 per profile), corrupted profiles recovered automatically
  • Native macOS - Built with SwiftUI, follows system conventions
  • Privacy-First - All data stored locally, no analytics, no cloud
  • Export Profiles - Save profiles as standard .hosts format files
  • Drag to Reorder - Organize profiles by dragging in the sidebar
  • Search & Filter - Find entries across large profiles (handles 100K+ entries)
  • URL Health Checks - Visual indicators show blocklist source availability

Installation

Download from sanehosts.com — $5 one-time purchase, free updates for life. DMGs are hosted on Cloudflare (not attached to GitHub releases).

Building from source? Consider buying the DMG for $5 to support continued development. Open source doesn't mean free labor.

Requirements

  • macOS 14.0 (Sonoma) or later
  • Administrator password (for hosts file modifications)

How It Works

  1. Choose a Protection Level - Pick from Essentials to Kitchen Sink, or create a custom profile
  2. Import Blocklists - Use curated presets or import from 200+ sources
  3. Activate - Apply the profile to your /etc/hosts file (password required once)
  4. Switch - Change profiles as needed, DNS cache is flushed automatically

Screenshots

See sanehosts.com for screenshots and demo.

Keyboard Shortcuts

Shortcut Action
⌘N New Profile
⌘I Import Blocklist
⌘A Select All Profiles
⌘D Duplicate Profile
⌘M Merge Selected Profiles
⌘E Export Profile
⌘⇧A Activate Profile
⌘⇧D Deactivate All
⌘⌫ Delete Profile
Delete Delete Selected (in list)

Privacy

SaneHosts is designed with privacy in mind:

  • All data stored locally in ~/Library/Application Support/SaneHosts/
  • No analytics, telemetry, or crash reporting
  • Network access only when YOU import from a remote URL

See PRIVACY.md for details.

Security

  • Hosts file modifications require admin authentication
  • Code signed and notarized by Apple
  • Hardened runtime enabled

See SECURITY.md for details.

Contributing

Before opening a PR:

  1. ⭐ Star the repo (if you haven't already)
  2. Read CONTRIBUTING.md
  3. Open an issue first to discuss major changes

Support

⭐ Star the repo if SaneHosts helps you. Stars help others discover quality open source.

Cloning without starring? For real bro? Gimme that star!

License

GPL v3 — see LICENSE for details.


Made with care by Mr. Sane

About

Modern, profile-based hosts file manager for macOS. Block ads, trackers, and distractions with ease.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •