Hosts database manager for *NIX systems
A command line tool for managing the hosts database on *NIX systems. Requires
bash >= 4.2.
Often it makes sense when developing a web application to use the host name for development so you create a host file mapping to point the domain name to the local loopback address:
Then you put the application live so you comment out the entry:
But you still need to switch between the local development version and the live version regularly which is when editing the hosts file manually becomes tedious.
hosts(1) tool which lets you manage the host file as a set of blocks which can be easily switched on or off.
The man page for
hosts(1) is available via the command
hosts help or you can view the online version if you prefer.
By default the blocks and other files are stored in
$hosts_storage with this directory layout:
.hosts ├── backup │ └── hosts ├── history │ └── hosts.1 ├── loopback │ └── hosts ├── blocks └── example.on
curl -# https://raw.github.com/freeformsystems/hosts/master/bin/install | bash
Will install the repositories into
/usr/local/lib and create a symlink to the
hosts executable in
Install with npm:
npm install -g hostfile
sudois only required if you do not have permission to write to the hosts file.
curlis only required if you wish to interact with the remote database to share blocks and/or profiles.
You can verify an installation with:
command -v hosts > /dev/null \ && hosts --version
If you used the quick install you can uninstall with the provided uninstall program located in
If you installed with npm then use the
npm rm hostfile
Verify you have
bash >= 4.2 using
bash --version. If you have an older version, you should update.
bake symlink to run the test suite:
You must have an active internet connection for all tests to pass as some tests query the database.