Giter Club home page Giter Club logo

hosts.prefpane's Introduction

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]

hosts.prefpane's People

Contributors

dirk- avatar specialunderwear avatar tom-seddon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hosts.prefpane's Issues

macOS Catalina issues

After upgrade to Catalina Hosts.prefpane closes and generated this error message:

Error en las preferencias
Se ha producido un error en el panel de preferencias Hosts.

Thanks a lot for your great app.

Kind regards.

backup/restore hosts.session

Is there a way to restore a .session file?
I have a lot of entries and don't want to enter every single line, so i've moved my hosts.session file from ~/Library/Application Support/Hosts Folder to make a backup.
Then i've copied the file back. when i start hosts there's no content to see and my hosts.session file gets overwritten with a blank file.

Yosemite table header glitch

On yosemite, the table header is no longer above the scrollable table area.
Unfortunately this is a bug in yosemite and not in Hosts.prefpane, which means a fix would be a hack.
If apple does not come with an update that fixes the problem, a hack would need to be implemented.

How to uninstall?

Hi, I've just installed the .pkg on my 10.8.2 Mountain Lion, but unfortunately now I'm unable to access to preferences window. How to uninstall it?

Thanks in advance!

Feature request: Comments

Thanks for a great tool!
I would love to be able to add comments for one or several lines to specify what function the addresses have.

Cheers!

Hosts File Resets Upon Reboot

Could use some help or insight, please. Love hosts.prefpane but having an issue. Each time I reboot my system it reverts my hosts file back to the original state of my hosts file at the time I first installed hosts.prefpane. I currently have v0.1.3 installed and am running Mountain Lion (10.8.2). Changes made in the pref panel and/or directly in the hosts file itself are not persisting between reboots of the system. Any help would be appreciated.

Thanks,
Steve

Certificate expired

When I tried to do a fresh install, macOS warned me that 'Developer ID installer: PermanentMarkers' certificate is expired.

Why the installer package?

I couldn't see any reason for the installer, so I just manually extracted Hosts.prefPane from the package and installed it by double clicking on Hosts.prefPane. Works fine -- is there some edge case that the installer package is solving?

Unable to add entry

When I add one character hostname like "a" or "f", this application alert Please enter a valid hostname.
But when hostname is "g", it is not alerted.

"aaaa" is bad, "aaaaa" is good.
"aaaf" is bad, "aaag" is good.

It strange to me.

[Request] Add notes section

I love this application, it made work on my team much more efficient for manipulation of our hosts files that we often change.

It'd be great if there was a way to just add notes to the entries in the prefpane, or possibly interpret comments from the host file. Though the former would be simpler, it'd be a useful addition to this already fantastic application.

How to uninstall (Crashed)

I would like to uninstall it from System Preferences because is broken, when I press the checkbox of the introduced hosts then crash. I am thinking about uninstalling it and install it again.

  • I tried to install directly without uninstalling it and didn't work.

Video issue

Let me know how can I proceed, thanks.

Unable to select/deselect entries

Entries are unable to be selected or deselected, clicking the checkboxes does nothing. I have included a screenshot of the preferences pane and my hosts file.

Screen shot 2012-12-18 at 12 14 09 PM

How do I install it?

I'm a newb and I don't know how to install this. Do I need to run one of the files in the root directory?

Problematic Install on OS X Yosemite

I tried installing this (version 1.3) and I got stuck on this screen with a spinning beachball (this was after I clicked "Install" but before it asks to enter my credentials):
locked

I was on that screen for 5-10 minutes before I restarted (had to force quit the installer). I then ran the installer again before I started any other programs and it worked fine. I'm on Yosemite 10.10.3:
yosemite

Mojave?

Hey,

Really love this preference pane. Use it all the time. Are you planning on updating it for compatibility with Mojave? There is a layout issue with the column headers, and dark mode would be cool too! :-)

impossible to add entry

hi!
on different systems, each time that i open prefpane and add or edit an entry i have this error message:

"syntax error, unexpected HOSTNAME, expecting END or COMMENT or ADDRESS or NEWLINE Should this line be permanently removed from /private/etc/hosts? Choose no to quit Hosts and manually correct the error."

what is the problem?
if i erase my host file and redo, i have the same error message...

After Upgrade to Big Sur

Unable to access Hosts module after upgrading to Big Sur. Receiving message "Preferences Error There was an error in Hosts Preferences". I tried re-installing, but that did not clear the issue.
2020-11-23_12-45-55

Prefpane Icon Size

Prefpanes are a bit unusual when it comes to icon sizes. Rather that using the standard 32, 64, 128, 256, 512 icon sizes, Apple uses 80px@2x and 40px@1px icons within the prefpanes, as evidenced by:

> identify /System/Library/PreferencePanes/Sidecar.prefPane/Contents/Resources/SidecarPrefPane.tiff 
/System/Library/PreferencePanes/Sidecar.prefPane/Contents/Resources/SidecarPrefPane.tiff[0] TIFF 80x80 80x80+0+0 8-bit sRGB 11824B 0.010u 0:00.002
/System/Library/PreferencePanes/Sidecar.prefPane/Contents/Resources/SidecarPrefPane.tiff[1] TIFF 40x40 40x40+0+0 8-bit sRGB 0.010u 0:00.001

It might be worthwhile updating the icon size to give it a crisp appearance.

Unable to edit entries

Editing existing entries within the hosts file using the Hosts Preferences Pane is generating "validation" issues. IP addresses entered are receiving the error "Please enter a valid IP address", while hostnames entered are receiving the error "Please enter a valid hostname".

Both dialog boxes have the options Discard Changes and OK, and both options clear the ip or hostname fields.

The IP address I used was 192.168.1.1 and the hostnames I used were www.google.com and google.com.

Screen shot 2012-12-18 at 10 44 59 AM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.