1 .\" Copyright (c) 2000 Manoj Srivastava <srivasta@debian.org>
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" Minor polishing, aeb
6 .\" Modified, 2002-06-16, Mike Coleman
8 .TH HOSTS 5 2021-03-22 "Linux man-pages (unreleased)"
10 hosts \- static table lookup for hostnames
16 This manual page describes the format of the
19 This file is a simple text file that associates IP addresses
20 with hostnames, one line per IP address.
21 For each host a single
22 line should be present with the following information:
25 IP_address canonical_hostname [aliases...]
28 The IP address can conform to either IPv4 or IPv6.
29 Fields of the entry are separated by any number of blanks and/or
31 Text from a "#" character until the end of the line is
32 a comment, and is ignored.
33 Host names may contain only alphanumeric
34 characters, minus signs ("\-"), and periods (".").
35 They must begin with an
36 alphabetic character and end with an alphanumeric character.
37 Optional aliases provide for name changes, alternate spellings,
38 shorter hostnames, or generic hostnames (for example,
40 If required, a host may have two separate entries in this file;
41 one for each version of the Internet Protocol (IPv4 and IPv6).
43 The Berkeley Internet Name Domain (BIND) Server implements the
44 Internet name server for UNIX systems.
45 It augments or replaces the
47 file or hostname lookup, and frees a host from relying on
49 being up to date and complete.
51 In modern systems, even though the host table has been superseded by
52 DNS, it is still widely used for:
55 Most systems have a small host table containing the name and address
56 information for important hosts on the local network.
58 when DNS is not running, for example during system bootup.
61 Sites that use NIS use the host table as input to the NIS host
63 Even though NIS can be used with DNS, most NIS sites still
64 use the host table with an entry for all local hosts as a backup.
67 Very small sites that are isolated from the network use the host table
69 If the local information rarely changes, and the
70 network is not connected to the Internet, DNS offers little
75 Modifications to this file normally take effect immediately,
76 except in cases where the file is cached by applications.
78 RFC\ 952 gave the original format for the host table, though it has
81 Before the advent of DNS, the host table was the only way of resolving
82 hostnames on the fledgling Internet.
83 Indeed, this file could be
84 created from the official host data base maintained at the Network
85 Information Control Center (NIC), though local changes were often
86 required to bring it up to date regarding unofficial aliases and/or
88 The NIC no longer maintains the hosts.txt files,
89 though looking around at the time of writing (circa 2000), there are
90 historical hosts.txt files on the WWW.
91 I just found three, from 92,
95 # The following lines are desirable for IPv4 capable hosts
98 # 127.0.1.1 is often used for the FQDN of the machine
99 127.0.1.1 thishost.mydomain.org thishost
100 192.168.1.10 foo.mydomain.org foo
101 192.168.1.13 bar.mydomain.org bar
102 146.82.138.7 master.debian.org master
103 209.237.226.90 www.opensource.org
105 # The following lines are desirable for IPv6 capable hosts
106 ::1 localhost ip6\-localhost ip6\-loopback
107 ff02::1 ip6\-allnodes
108 ff02::2 ip6\-allrouters
121 .\" This manual page was written by Manoj Srivastava <srivasta@debian.org>,
122 .\" for the Debian GNU/Linux system.