add-etc-hosts - add/remove an hostname to/from /etc/hosts
add-etc-hosts [ -6 ] [ hostname ]
rm-etc-hosts [ -6 ] [ hostname ]
This manual page documents briefly the add-etc-hosts and the rm-etc-hosts commands.
add-etc-hosts is a script that enables a local "bogus" hostname to
be used on the loopback interface for development purposes. While
developing sites locally it's convenient to refer to the sites through
an handle so that they can easily be reached. The way to do that is by
/etc/hosts file and adding the desired hostname to the
line relative to
127.0.0.1. This script automates that process.
-6 optional argument is specified then it adds the hostname
also to the IPv6 loopback
Likewise, rm-etc-hosts disables a hostname by removing the hostname
If the hostname exists already in
/etc/hosts then trying to add it
again has no effect.
If the hostname doesn't exist in
/etc/hosts then trying to remove it
has no effect.
Enable a site (IPv4 only):
Disable a site (IPv4 only):
Enable a site (IPv4 and IPv6):
Disable a site (IPv4 and IPv6):
rm-etc-hosts -6 img.host-local
The hosts file. Where local addresses are mapped to hostnames.
add-etc-hosts is Copyright (C) 2011 Antonio P. P. Almeida <email@example.com> under the terms of a MIT license.
The latest version of add-etc-hosts is available from: https://github.com/perusio/add-etc-hosts.
add-etc-hosts was written by Antonio P. P. Almeida <firstname.lastname@example.org> that also wrote the manual page.