]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man5/hosts.5
05dd1be6df65c10fef2aa69f0975cb1682e70079
[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 .\" 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, write to the Free
21 .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
22 .\" USA.
23 .\"
24 .\" Minor polishing, aeb
25 .\" Modified, 2002-06-16, Mike Coleman
26 .\"
27 .TH HOSTS 5 2002-06-16 "Debian" "Linux Programmer's Manual"
28 .SH NAME
29 hosts \- The static table lookup for host names
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. This file is a simple text file that associates IP addresses
36 with hostnames, one line per IP address. For each host a single
37 line should be present with the following information:
38 .RS
39 .PP
40 IP_address canonical_hostname [aliases...]
41 .RE
42 .PP
43 Fields of the entry are separated by any number of blanks and/or
44 tab characters. Text from a "#" character until the end of the line is
45 a comment, and is ignored. Host names may contain only alphanumeric
46 characters, minus signs ("\-"), and periods ("."). They must begin with an
47 alphabetic character and end with an alphanumeric character.
48 Optional aliases provide for name changes, alternate spellings,
49 shorter hostnames, or generic hostnames (for example,
50 .IR localhost ).
51 .PP
52 The Berkeley Internet Name Domain (BIND) Server implements the
53 Internet name server for UNIX systems. It augments or replaces the
54 .I /etc/hosts
55 file or host name lookup, and frees a host from relying on
56 .I /etc/hosts
57 being up to date and complete.
58 .PP
59 In modern systems, even though the host table has been superseded by
60 DNS, it is still widely used for:
61 .TP
62 .B bootstrapping
63 Most systems have a small host table containing the name and address
64 information for important hosts on the local network. This is useful
65 when DNS is not running, for example during system bootup.
66 .TP
67 .B NIS
68 Sites that use NIS use the host table as input to the NIS host
69 database. Even though NIS can be used with DNS, most NIS sites still
70 use the host table with an entry for all local hosts as a backup.
71 .TP
72 .B isolated nodes
73 Very small sites that are isolated from the network use the host table
74 instead of DNS. If the local information rarely changes, and the
75 network is not connected to the Internet, DNS offers little
76 advantage.
77 .SH EXAMPLE
78 .nf
79 127.0.0.1 localhost
80 192.168.1.10 foo.mydomain.org foo
81 192.168.1.13 bar.mydomain.org bar
82 146.82.138.7 master.debian.org master
83 209.237.226.90 www.opensource.org
84 .fi
85 .SH "NOTE"
86 Modifications to this file normally take effect immediately,
87 except in cases where the file is cached by applications.
88 .SH "HISTORICAL NOTES"
89 RFC 952 gave the original format for the host table, though it has
90 since changed.
91
92 Before the advent of DNS, the host table was the only way of resolving
93 hostnames on the fledgling Internet. Indeed, this file could be
94 created from the official host data base maintained at the Network
95 Information Control Center (NIC), though local changes were often
96 required to bring it up to date regarding unofficial aliases and/or
97 unknown hosts. The NIC no longer maintains the hosts.txt files,
98 though looking around at the time of writing (circa 2000), there are
99 historical hosts.txt files on the WWW. I just found three, from 92,
100 94, and 95.
101 .SH FILES
102 .I /etc/hosts
103 .SH "SEE ALSO"
104 .BR hostname (1),
105 .BR resolver (3),
106 .BR resolver (5),
107 .BR hostname (7),
108 .BR named (8),
109 Internet RFC 952
110 .SH AUTHOR
111 This manual page was written by Manoj Srivastava <srivasta@debian.org>,
112 for the Debian GNU/Linux system.