Permalink
Browse files

* Updated the README and the man page with IPv6 information.

  • Loading branch information...
1 parent 0e4efcb commit 630fdf786f3bc382dbf9c7bec1fe02569f3d28f8 @perusio committed Jan 5, 2012
Showing with 55 additions and 10 deletions.
  1. +8 −0 README.md
  2. +34 −5 man/add-etc-hosts.8
  3. +13 −5 man/add-etc-hosts.8.ronn
View
@@ -22,6 +22,14 @@ directive to your vhost configuration (server context), like this:
server_name mywidgetmaker.local;
+If I want to add an **IPv6** hostname I specify the optional argument
+`-6`:
+
+ add-etc-hosts -6 mywidgetmaker.local
+
+Now there's an IPv6 loopback hostname. You can access your new IPv6
+host.
+
## Installation
1. Clone the git [repo](git://github.com/perusio/add-etc-hosts.git) or [download](https://github.com/perusio/add-etc-hosts/archives/master) it.
View
@@ -1,16 +1,16 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "ADD\-ETC\-HOSTS" "8" "August 2011" "" ""
+.TH "ADD\-ETC\-HOSTS" "8" "January 2012" "" ""
.
.SH "NAME"
\fBadd\-etc\-hosts\fR \- add/remove an hostname to/from /etc/hosts
.
.SH "SYNOPSIS"
-\fBadd\-etc\-hosts\fR [ \fIhostname\fR ]
+\fBadd\-etc\-hosts\fR [ \-6 ] [ \fIhostname\fR ]
.
.br
-\fBrm\-etc\-hosts\fR [ \fIhostname\fR ]
+\fBrm\-etc\-hosts\fR [ \-6 ] [ \fIhostname\fR ]
.
.br
.
@@ -21,6 +21,9 @@ This manual page documents briefly the add\-etc\-hosts and the rm\-etc\-hosts co
add\-etc\-hosts is a script that \fBenables\fR 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 editing the \fB/etc/hosts\fR file and adding the desired hostname to the line relative to \fB127\.0\.0\.1\fR\. This script automates that process\.
.
.P
+If the \fB\-6\fR optional argument is specified then it adds the hostname also to the IPv6 loopback \fB::1\fR\.
+.
+.P
Likewise, rm\-etc\-hosts disables a hostname by removing the hostname from \fB/etc/hosts\fR\.
.
.P
@@ -30,7 +33,7 @@ If the hostname exists already in \fB/etc/hosts\fR then trying to add it again h
If the hostname doesn\'t exist in \fB/etc/hosts\fR then trying to remove it has no effect\.
.
.SH "EXAMPLES"
-Enable a site:
+Enable a site (IPv4 only):
.
.IP "" 4
.
@@ -43,7 +46,7 @@ add\-etc\-hosts my\.local\.wp\.site
.IP "" 0
.
.P
-Disable a site:
+Disable a site (IPv4 only):
.
.IP "" 4
.
@@ -55,6 +58,32 @@ rm\-etc\-hosts static\.host\-local
.
.IP "" 0
.
+.P
+Enable a site (IPv4 and IPv6):
+.
+.IP "" 4
+.
+.nf
+
+add\-etc\-hosts my\.local\.drupal\.site
+.
+.fi
+.
+.IP "" 0
+.
+.P
+Disable a site (IPv4 and IPv6):
+.
+.IP "" 4
+.
+.nf
+
+rm\-etc\-hosts \-6 img\.host\-local
+.
+.fi
+.
+.IP "" 0
+.
.SH "FILES"
\fB/etc/hosts\fR
.
@@ -3,8 +3,8 @@ rm-etc-hosts, add-etc-hosts -- add/remove an hostname to/from /etc/hosts
## SYNOPSIS
-`add-etc-hosts` [ <hostname> ] <br>
-`rm-etc-hosts` [ <hostname> ] <br>
+`add-etc-hosts` [ -6 ] [ <hostname> ] <br>
+`rm-etc-hosts` [ -6 ] [ <hostname> ] <br>
## DESCRIPTION
@@ -18,6 +18,9 @@ an handle so that they can easily be reached. The way to do that is by
editing the `/etc/hosts` file and adding the desired hostname to the
line relative to `127.0.0.1`. This script automates that process.
+If the `-6` optional argument is specified then it adds the hostname
+also to the IPv6 loopback `::1`.
+
Likewise, rm-etc-hosts disables a hostname by removing the hostname
from `/etc/hosts`.
@@ -29,12 +32,17 @@ has no effect.
## EXAMPLES
-Enable a site:
+Enable a site (IPv4 only):
add-etc-hosts my.local.wp.site
-Disable a site:
+Disable a site (IPv4 only):
rm-etc-hosts static.host-local
-
+
+Enable a site (IPv4 and IPv6):
+ add-etc-hosts my.local.drupal.site
+
+Disable a site (IPv4 and IPv6):
+ rm-etc-hosts -6 img.host-local
## FILES
`/etc/hosts` <br>

0 comments on commit 630fdf7

Please sign in to comment.