]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/hosts.5
getrlimit.2: Correct information about large limits on 32-bit architectures
[thirdparty/man-pages.git] / man5 / hosts.5
CommitLineData
fea681da
MK
1.\" Copyright (c) 2000 Manoj Srivastava <srivasta@debian.org>
2.\"
1dd72f9c 3.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
fea681da
MK
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
c715f741
MK
20.\" License along with this manual; if not, see
21.\" <http://www.gnu.org/licenses/>.
6a8d8745 22.\" %%%LICENSE_END
fea681da
MK
23.\"
24.\" Minor polishing, aeb
25.\" Modified, 2002-06-16, Mike Coleman
26.\"
4b8c67d9 27.TH HOSTS 5 2017-09-15 "Linux" "Linux Programmer's Manual"
fea681da 28.SH NAME
eebc6bfc 29hosts \- static table lookup for hostnames
fea681da
MK
30.SH SYNOPSIS
31.B /etc/hosts
32.SH DESCRIPTION
c13182ef 33This manual page describes the format of the
fea681da 34.I /etc/hosts
c13182ef
MK
35file.
36This file is a simple text file that associates IP addresses
37with hostnames, one line per IP address.
38For each host a single
fea681da
MK
39line should be present with the following information:
40.RS
41.PP
80ee1d97 42IP_address canonical_hostname [aliases...]
fea681da
MK
43.RE
44.PP
45Fields of the entry are separated by any number of blanks and/or
c13182ef
MK
46tab characters.
47Text from a "#" character until the end of the line is
48a comment, and is ignored.
49Host names may contain only alphanumeric
50characters, minus signs ("\-"), and periods (".").
51They must begin with an
fea681da 52alphabetic character and end with an alphanumeric character.
80ee1d97 53Optional aliases provide for name changes, alternate spellings,
fea681da
MK
54shorter hostnames, or generic hostnames (for example,
55.IR localhost ).
fea681da
MK
56.PP
57The Berkeley Internet Name Domain (BIND) Server implements the
008f1ecc 58Internet name server for UNIX systems.
c13182ef 59It augments or replaces the
fea681da 60.I /etc/hosts
ddaec46d 61file or hostname lookup, and frees a host from relying on
fea681da 62.I /etc/hosts
c13182ef 63being up to date and complete.
fea681da
MK
64.PP
65In modern systems, even though the host table has been superseded by
66DNS, it is still widely used for:
67.TP
68.B bootstrapping
69Most systems have a small host table containing the name and address
c13182ef
MK
70information for important hosts on the local network.
71This is useful
72when DNS is not running, for example during system bootup.
fea681da
MK
73.TP
74.B NIS
75Sites that use NIS use the host table as input to the NIS host
c13182ef
MK
76database.
77Even though NIS can be used with DNS, most NIS sites still
78use the host table with an entry for all local hosts as a backup.
79.TP
fea681da
MK
80.B isolated nodes
81Very small sites that are isolated from the network use the host table
c13182ef
MK
82instead of DNS.
83If the local information rarely changes, and the
fea681da 84network is not connected to the Internet, DNS offers little
c13182ef 85advantage.
2b2581ee
MK
86.SH FILES
87.I /etc/hosts
19c98696 88.SH NOTES
80ee1d97
MK
89Modifications to this file normally take effect immediately,
90except in cases where the file is cached by applications.
73d8cece 91.SS Historical notes
331da7c3 92RFC\ 952 gave the original format for the host table, though it has
80ee1d97 93since changed.
eabf3ae5 94.PP
fea681da 95Before the advent of DNS, the host table was the only way of resolving
c13182ef
MK
96hostnames on the fledgling Internet.
97Indeed, this file could be
fea681da
MK
98created from the official host data base maintained at the Network
99Information Control Center (NIC), though local changes were often
100required to bring it up to date regarding unofficial aliases and/or
c13182ef
MK
101unknown hosts.
102The NIC no longer maintains the hosts.txt files,
fea681da 103though looking around at the time of writing (circa 2000), there are
c13182ef
MK
104historical hosts.txt files on the WWW.
105I just found three, from 92,
fea681da 10694, and 95.
2b2581ee 107.SH EXAMPLE
a2b7a144 108.EX
8528c989 109# The following lines are desirable for IPv4 capable hosts
2b2581ee 110127.0.0.1 localhost
8528c989
SA
111
112# 127.0.1.1 is often used for the FQDN of the machine
113127.0.1.1 thishost.mydomain.org thishost
2b2581ee
MK
114192.168.1.10 foo.mydomain.org foo
115192.168.1.13 bar.mydomain.org bar
116146.82.138.7 master.debian.org master
117209.237.226.90 www.opensource.org
8528c989
SA
118
119# The following lines are desirable for IPv6 capable hosts
120::1 localhost ip6-localhost ip6-loopback
121ff02::1 ip6-allnodes
122ff02::2 ip6-allrouters
a2b7a144 123.EE
47297adb 124.SH SEE ALSO
fea681da 125.BR hostname (1),
2da61423 126.BR resolver (3),
7b46b4fa
SA
127.BR host.conf (5),
128.BR resolv.conf (5),
fea681da
MK
129.BR resolver (5),
130.BR hostname (7),
173fe7e7 131.BR named (8)
eabf3ae5 132.PP
331da7c3 133Internet RFC\ 952
fd7f0a7f
MK
134.\" .SH AUTHOR
135.\" This manual page was written by Manoj Srivastava <srivasta@debian.org>,
136.\" for the Debian GNU/Linux system.