Host file for browser?
Bill Sconce
sconce at in-spec-inc.com
Thu Dec 9 16:55:01 EST 2004
On Thu, 9 Dec 2004 12:49:29 -0500
"jason" <jason at kernbuilt.com> wrote:
> All,
>
> I have several boxes kobbled together along with my web server living
> happily behind my firewall. In order to get windows (IE, NETSCAP et al) to
> see the sites served up on the web server I have to adjust the hosts file in
> /WINDOWS/system32/drivers/etc/ telling the specific local IP address for a
> specific site. Is there a similar way to tell Linux (RH9) to do the same?
> (galeon, mozilla et al).
>
> Thanks,
>
> Jason Kern
>
> KernBuilt.com
Hi, Jason -
The other replies are correct (that the thing you want is the /etc/hosts
file, and that it was "etc" on Unix before that other OS swiped it).
To leave just a little more (hopefully useful) information in this
mailing list, following are a hypothetical sample of the contents of
an /etc/hosts file (including a fake top-level domain, as might be used
for debugging/devoloping a Web site) and a clip from the material which
"man hosts" displays. (The last paragraph probably describes your
situation (and mine)).
-Bill
# Sample /etc/hosts
172.16.1.1 igor
172.16.1.2 drfrank
172.16.1.2 bdawson.com
172.16.1.7 laptop
127.0.0.1 localhost localhost.localdomain
# man hosts
NAME
hosts - The static table lookup for host names
SYNOPSIS
/etc/hosts
DESCRIPTION
This manual page describes the format of the /etc/hosts file. This file
is a simple text file that associates IP addresses with hostnames, one
line per IP address. For each host a single line should be present with
the following information:
IP_address canonical_hostname aliases
Fields of the entry are separated by any number of blanks and/or tab
characters. Text from a "#" character until the end of the line is a
comment, and is ignored.
...
The Berkeley Internet Name Domain (BIND) Server implements the Internet
name server for UNIX systems. It replaces the /etc/hosts file or host
name lookup, and frees a host from relying on /etc/hosts being up to
date and complete.
In modern systems, even though the host table has been superseded by
DNS, it is still widely used for
bootstrapping
Most systems have a small host table containing the name and
address information for important hosts on the local network.
This is useful when DNS is not running, for example during sys-
tem bootup.
...
isolated nodes
Very small sites that are isolated from the network use the host
table instead of DNS. If the local information rarely changes,
and the network is not connected to the internet, DNS offers
little advantage.
More information about the gnhlug-discuss
mailing list