https://github.com/sane-apps/SaneHosts
Modern, profile-based hosts file manager for macOS. Block ads, trackers, and distractions with ease.
https://github.com/sane-apps/SaneHosts
ad-blocker dns hosts-file macos macos-app open-source privacy swift swiftui tracker-blocker
Last synced: 2 months ago
JSON representation
Modern, profile-based hosts file manager for macOS. Block ads, trackers, and distractions with ease.
- Host: GitHub
- URL: https://github.com/sane-apps/SaneHosts
- Owner: sane-apps
- License: other
- Created: 2026-01-19T19:07:02.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-03-27T15:14:45.000Z (2 months ago)
- Last Synced: 2026-03-28T00:46:38.109Z (2 months ago)
- Topics: ad-blocker, dns, hosts-file, macos, macos-app, open-source, privacy, swift, swiftui, tracker-blocker
- Language: Swift
- Homepage: https://sanehosts.com
- Size: 129 MB
- Stars: 8
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Roadmap: docs/ROADMAP.md
Awesome Lists containing this project
- awesome-swift-macos-apps - SaneHosts - apps/SaneHosts?style=flat&label=" /> <img align="bottom" height="13" src="https://img.shields.io/github/last-commit/sane-apps/SaneHosts?style=flat&label=" /> - Modern hosts file manager โ block ads, trackers, and malware with curated protection levels. (Security / Text)
README
# SaneHosts
> Modern hosts file manager for macOS
[](https://github.com/sane-apps/SaneHosts/stargazers)
[](LICENSE)
[](https://www.apple.com/macos)
[](https://swift.org)
[-black)](https://github.com/serhii-londar/open-source-mac-os-apps)
> **โญ Star this repo if it's useful!** ยท **[๐ฐ Buy for $6.99](https://sanehosts.com)** ยท 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, and malware. Safe for everyone. |
| **Family Safe** | Essentials + adult content and gambling sites |
| **Focus Mode** | Family Safe + social media distractions |
| **Privacy Shield** | Focus Mode + telemetry and advanced trackers |
| **Kitchen Sink** | Maximum protection. Blocks everything we can. |
### 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** - Your hosts data stays on your Mac, with only a few simple app counts and optional network features
- **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](https://sanehosts.com)** โ Signed, notarized, ready to use.
> *I wanted to make it $5, but processing fees and taxes were... insane. โ Mr. Sane*
**Building from source?** The app resolves `SaneUI` automatically from GitHub outside the monorepo. Consider [buying the app](https://sanehosts.com) to support continued development.
## 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](https://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 personal content uploaded to SaneApps servers
- The app may send a few simple anonymous counts, like whether it opened in Basic or Pro
- Network access is limited to remote imports you choose, update checks, and those simple app counts
See [PRIVACY.md](PRIVACY.md) for details.
## Security
- Hosts file modifications require admin authentication
- Code signed and notarized by Apple
- Hardened runtime enabled
See [SECURITY.md](SECURITY.md) for details.
## Documentation
| Document | Purpose |
|----------|---------|
| [README.md](README.md) | Product overview and doc map |
| [ARCHITECTURE.md](ARCHITECTURE.md) | App structure and state flow |
| [DEVELOPMENT.md](DEVELOPMENT.md) | Build, test, and workflow SOP |
| [PRIVACY.md](PRIVACY.md) | Privacy practices and limited network behavior |
| [SECURITY.md](SECURITY.md) | Security policy and reporting |
| [`website/`](website/) | Public website and guide pages |
| [`docs/`](docs/) | Internal product and release reference docs |
## Contributing
Before opening a PR:
1. **[โญ Star the repo](https://github.com/sane-apps/SaneHosts)** (if you haven't already)
2. Read [CONTRIBUTING.md](CONTRIBUTING.md)
3. Open an issue first to discuss major changes
## Support
**[โญ Star the repo](https://github.com/sane-apps/SaneHosts)** if SaneHosts helps you. Stars help others discover quality software.
**Cloning without starring?** For real bro? Gimme that star!
- ๐ [Report a Bug](https://github.com/sane-apps/SaneHosts/issues/new?template=bug_report.md)
- ๐ก [Request a Feature](https://github.com/sane-apps/SaneHosts/issues/new?template=feature_request.md)
## License
[PolyForm Shield 1.0.0](https://polyformproject.org/licenses/shield/1.0.0) โ free for personal use and experimentation. See [LICENSE](LICENSE) for details.
---
Made with care by [Mr. Sane](https://github.com/sane-apps)
## Third-Party Notices
Third-party open-source attributions are documented in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
### Become a Contributor (Even if You Don't Code)
Are you tired of waiting on the dev to get around to fixing your problem?
Do you have a great idea that could help everyone in the community, but think you can't do anything about it because you're not a coder?
Good news: you actually can.
Copy and paste this into Claude or Codex, then describe your bug or idea:
```text
I want to contribute to this repo, but I'm not a coder.
Repository:
https://github.com/sane-apps/SaneHosts
Bug or idea:
[Describe your bug or idea here in plain English]
Please do this for me:
1) Understand and reproduce the issue (or understand the feature request).
2) Make the smallest safe fix.
3) Open a pull request to https://github.com/sane-apps/SaneHosts
4) Give me the pull request link.
5) Open a GitHub issue in https://github.com/sane-apps/SaneHosts/issues that includes:
- the pull request link
- a short summary of what changed and why
6) Also give me the exact issue link.
Important:
- Keep it focused on this one issue/idea.
- Do not make unrelated changes.
```
If needed, you can also just email the pull request link to hi@saneapps.com.
I review and test every pull request before merge.
If your PR is merged, I will publicly give you credit, and you'll have the satisfaction of knowing you helped ship a fix for everyone.