Skip to content

specialunderwear/Hosts.prefpane

Repository files navigation

Hosts, a system preference pane to manage your hosts file

Hosts adds a preference pane to your system preferences which lets you toggle your host file entries on and off, as well as add and remove them.

Hosts.prefpane likes to keep your hosts file clean. When an entry is toggled off, it is not commented out in the hosts file, but instead stored in the app's preferences storage. This means you will have to uncomment all your unused host entries and untoggle them in the prefpane if you want to use them. Comments are treated as comments and will never show up in the list of host entries!

Of course Hosts.prefpane will detect edits you made to the /etc/hosts directly and merge them into the listing.

Backups of your hosts file are made in ~/Library/Application Support/Hosts. The backup or your hosts file from before you started using Hosts.prefpane is called hosts.orig and each session a backup is made called hosts.session.

The default host entries that are needed by the OS are hidden and can not be edited using Hosts.prefpane.

Many thanks to the contributors for helping getting the latest release done!

Download

For now you'll find the latest pre-built preference pane and the app on Dirk-'s website. Hosts App 1.4.5.zip includes the app which can be used from any location on your disk. Hosts PrefPane 1.4.5.pkg is an installer for the preference pane. It will get installed into /Library/PreferencePanes, so you have to enter your admin credentials during installation. The installer is neccessary for macOS Catalina, since all executables have to be notarized, and you cannot notarize a preference pane.

Development hints

Compiling the parser

To compile the parser protion of the Hosts PrefPane, you need to have bison installed somewhere. The current compiler setting expects bison to be in /usr/local/opt/bison/bin/. This is where Homebrew installs it (brew install bison).

Catalina Installation

Preparing the app for installation on Catalina (macOS 10.15) or higher is straightforward. Just "Archive" the app from Xcode and go through the normal notarization process.

Preparing the preference pane for installation on Catalina is not that easy. You have to build an installer by using command line tools and deal with all the right developer certificates. Here is a good description of the process using a command line tool as an example project.

Licence

Hosts, a system preference pane to manage your hosts file.
Copyright (C) 2011  PermanentMarkers

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

Contact maintainer at [email protected]