OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man5 / hosts.5
1 .\" Copyright (c) 2000 Manoj Srivastava <srivasta@debian.org>
2 .\"
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
22 .\" %%%LICENSE_END
23 .\"
24 .\" Minor polishing, aeb
25 .\" Modified, 2002-06-16, Mike Coleman
26 .\"
27 .TH HOSTS 5 2002-06-16 "Linux" "Linux Programmer's Manual"
28 .SH NAME
29 hosts \- static table lookup for hostnames
30 .SH SYNOPSIS
31 .B /etc/hosts
32 .SH DESCRIPTION
33 This manual page describes the format of the
34 .I /etc/hosts
35 file.
36 This file is a simple text file that associates IP addresses
37 with hostnames, one line per IP address.
38 For each host a single
39 line should be present with the following information:
40 .RS
41 .PP
42 IP_address canonical_hostname [aliases...]
43 .RE
44 .PP
45 Fields of the entry are separated by any number of blanks and/or
46 tab characters.
47 Text from a "#" character until the end of the line is
48 a comment, and is ignored.
49 Host names may contain only alphanumeric
50 characters, minus signs ("\-"), and periods (".").
51 They must begin with an
52 alphabetic character and end with an alphanumeric character.
53 Optional aliases provide for name changes, alternate spellings,
54 shorter hostnames, or generic hostnames (for example,
55 .IR localhost ).
56 .PP
57 The Berkeley Internet Name Domain (BIND) Server implements the
58 Internet name server for UNIX systems.
59 It augments or replaces the
60 .I /etc/hosts
61 file or hostname lookup, and frees a host from relying on
62 .I /etc/hosts
63 being up to date and complete.
64 .PP
65 In modern systems, even though the host table has been superseded by
66 DNS, it is still widely used for:
67 .TP
68 .B bootstrapping
69 Most systems have a small host table containing the name and address
70 information for important hosts on the local network.
71 This is useful
72 when DNS is not running, for example during system bootup.
73 .TP
74 .B NIS
75 Sites that use NIS use the host table as input to the NIS host
76 database.
77 Even though NIS can be used with DNS, most NIS sites still
78 use the host table with an entry for all local hosts as a backup.
79 .TP
80 .B isolated nodes
81 Very small sites that are isolated from the network use the host table
82 instead of DNS.
83 If the local information rarely changes, and the
84 network is not connected to the Internet, DNS offers little
85 advantage.
86 .SH FILES
87 .I /etc/hosts
88 .SH NOTES
89 Modifications to this file normally take effect immediately,
90 except in cases where the file is cached by applications.
91 .SS Historical notes
92 RFC\ 952 gave the original format for the host table, though it has
93 since changed.
94
95 Before the advent of DNS, the host table was the only way of resolving
96 hostnames on the fledgling Internet.
97 Indeed, this file could be
98 created from the official host data base maintained at the Network
99 Information Control Center (NIC), though local changes were often
100 required to bring it up to date regarding unofficial aliases and/or
101 unknown hosts.
102 The NIC no longer maintains the hosts.txt files,
103 though looking around at the time of writing (circa 2000), there are
104 historical hosts.txt files on the WWW.
105 I just found three, from 92,
106 94, and 95.
107 .SH EXAMPLE
108 .nf
109 127.0.0.1       localhost
110 192.168.1.10    foo.mydomain.org       foo
111 192.168.1.13    bar.mydomain.org       bar
112 146.82.138.7    master.debian.org      master
113 209.237.226.90  www.opensource.org
114 .fi
115 .SH SEE ALSO
116 .BR hostname (1),
117 .BR resolver (3),
118 .BR resolver (5),
119 .BR hostname (7),
120 .BR named (8)
121
122 Internet RFC\ 952
123 .\" .SH AUTHOR
124 .\" This manual page was written by Manoj Srivastava <srivasta@debian.org>,
125 .\" for the Debian GNU/Linux system.
126 .SH COLOPHON
127 This page is part of release 3.79 of the Linux
128 .I man-pages
129 project.
130 A description of the project,
131 information about reporting bugs,
132 and the latest version of this page,
133 can be found at
134 \%http://www.kernel.org/doc/man\-pages/.