xref: /freebsd/share/man/man5/hosts.5 (revision 97759ccc715c4b365432c16d763c50eecfcb1100)
1afe61c15SRodney W. Grimes.\" Copyright (c) 1983, 1991, 1993
2afe61c15SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3afe61c15SRodney W. Grimes.\"
4afe61c15SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
5afe61c15SRodney W. Grimes.\" modification, are permitted provided that the following conditions
6afe61c15SRodney W. Grimes.\" are met:
7afe61c15SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
8afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
9afe61c15SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
10afe61c15SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
11afe61c15SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
12dda5b397SEitan Adler.\" 3. Neither the name of the University nor the names of its contributors
13afe61c15SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
14afe61c15SRodney W. Grimes.\"    without specific prior written permission.
15afe61c15SRodney W. Grimes.\"
16afe61c15SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17afe61c15SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18afe61c15SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19afe61c15SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20afe61c15SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21afe61c15SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22afe61c15SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23afe61c15SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24afe61c15SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25afe61c15SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26afe61c15SRodney W. Grimes.\" SUCH DAMAGE.
27afe61c15SRodney W. Grimes.\"
28*0090d182SGordon Bergling.Dd September 15, 2022
29afe61c15SRodney W. Grimes.Dt HOSTS 5
303d45e180SRuslan Ermilov.Os
31afe61c15SRodney W. Grimes.Sh NAME
32afe61c15SRodney W. Grimes.Nm hosts
33afe61c15SRodney W. Grimes.Nd host name data base
34afe61c15SRodney W. Grimes.Sh DESCRIPTION
35afe61c15SRodney W. GrimesThe
364b66483fSRuslan Ermilov.Nm
37afe61c15SRodney W. Grimesfile contains information regarding
38afe61c15SRodney W. Grimesthe known hosts on the network.
39248aee62SJacques VidrineIt can be used in conjunction with DNS, and the NIS
40248aee62SJacques Vidrinemaps `hosts.byaddr' and `hosts.byname', as controlled by
41248aee62SJacques Vidrine.Xr nsswitch.conf 5 .
42afe61c15SRodney W. GrimesFor each host a single line should be present
43afe61c15SRodney W. Grimeswith the following information:
44afe61c15SRodney W. Grimes.Bd -unfilled -offset indent
45afe61c15SRodney W. GrimesInternet address
467b3eb001SNate Williamsofficial host name
47afe61c15SRodney W. Grimesaliases
48afe61c15SRodney W. Grimes.Ed
49afe61c15SRodney W. Grimes.Pp
50afe61c15SRodney W. GrimesItems are separated by any number of blanks and/or
515203edcdSRuslan Ermilovtab characters.
525203edcdSRuslan ErmilovA ``#'' indicates the beginning of
53afe61c15SRodney W. Grimesa comment; characters up to the end of the line are
54afe61c15SRodney W. Grimesnot interpreted by routines which search the file.
55afe61c15SRodney W. Grimes.Pp
5654c22eeaSSergey KandaurovThis file provides a backup used when the name server
57afe61c15SRodney W. Grimesis not running.
58afe61c15SRodney W. GrimesFor the name server, it is suggested that only a few addresses
59afe61c15SRodney W. Grimesbe included in this file.
604043c58eSTim VanderhoekThese include addresses for the local interfaces that
61afe61c15SRodney W. Grimes.Xr ifconfig 8
62afe61c15SRodney W. Grimesneeds at boot time and a few machines on the local network.
63afe61c15SRodney W. Grimes.Pp
64a23b08cfSCeri DaviesNetwork addresses are specified in either the conventional
65a23b08cfSCeri Davies``.'' (dot) notation for IPv4 or colon hexadecimal notation for IPv6,
66a23b08cfSCeri Daviesas understood by the
67a23b08cfSCeri Davies.Xr inet_pton 3
68afe61c15SRodney W. Grimesroutine
69afe61c15SRodney W. Grimesfrom the Internet address manipulation library,
70afe61c15SRodney W. Grimes.Xr inet 3 .
71afe61c15SRodney W. GrimesHost names may contain any printable
72afe61c15SRodney W. Grimescharacter other than a field delimiter, newline,
73afe61c15SRodney W. Grimesor comment character.
74afe61c15SRodney W. Grimes.Sh FILES
75afe61c15SRodney W. Grimes.Bl -tag -width /etc/hosts -compact
76afe61c15SRodney W. Grimes.It Pa /etc/hosts
77afe61c15SRodney W. GrimesThe
784b66483fSRuslan Ermilov.Nm
79afe61c15SRodney W. Grimesfile resides in
80afe61c15SRodney W. Grimes.Pa /etc .
81afe61c15SRodney W. Grimes.El
82afe61c15SRodney W. Grimes.Sh SEE ALSO
83afe61c15SRodney W. Grimes.Xr gethostbyname 3 ,
84a23b08cfSCeri Davies.Xr inet 3 ,
85248aee62SJacques Vidrine.Xr nsswitch.conf 5 ,
8654c22eeaSSergey Kandaurov.Xr ifconfig 8
87afe61c15SRodney W. Grimes.Sh HISTORY
88afe61c15SRodney W. GrimesThe
89afe61c15SRodney W. Grimes.Nm
90afe61c15SRodney W. Grimesfile format appeared in
91c22076b5SWarner Losh.Bx 4.1c .
92