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