blob: 2e4a7b96d8e541bdf2d8a9a4f8e70cf56384b733 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
<table class="head">
<tr>
<td class="head-ltitle">HOSTS(5)</td>
<td class="head-vol">File Formats Manual</td>
<td class="head-rtitle">HOSTS(5)</td>
</tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">hosts</code> — <span class="Nd">host name
data base</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The <code class="Nm">hosts</code> file contains information
regarding the known hosts on the network. It can be used in conjunction with
DNS, and the NIS maps `hosts.byaddr' and `hosts.byname', as controlled by
<a class="Xr">nsswitch.conf(5)</a>. For each host a single line should be
present with the following information:</p>
<div class="Bd Pp Bd-indent">
<pre>Internet address
official host name
aliases</pre>
</div>
<p class="Pp">Items are separated by any number of blanks and/or tab characters.
A ``#'' indicates the beginning of a comment; characters up to the end of
the line are not interpreted by routines which search the file.</p>
<p class="Pp">This file provides a backup used when the name server is not
running. For the name server, it is suggested that only a few addresses be
included in this file. These include addresses for the local interfaces that
<a class="Xr">ifconfig(8)</a> needs at boot time and a few machines on the
local network.</p>
<p class="Pp">Network addresses are specified in either the conventional ``.''
(dot) notation for IPv4 or colon hexadecimal notation for IPv6, as
understood by the <a class="Xr">inet_pton(3)</a> routine from the Internet
address manipulation library, <a class="Xr">inet(3)</a>. Host names may
contain any printable character other than a field delimiter, newline, or
comment character.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="FILES"><a class="permalink" href="#FILES">FILES</a></h1>
<dl class="Bl-tag Bl-compact">
<dt><span class="Pa">/etc/hosts</span></dt>
<dd>The <code class="Nm">hosts</code> file resides in
<span class="Pa">/etc</span>.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<p class="Pp"><a class="Xr">gethostbyname(3)</a>, <a class="Xr">inet(3)</a>,
<a class="Xr">nsswitch.conf(5)</a>, <a class="Xr">ifconfig(8)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Nm">hosts</code> file format appeared in
<span class="Ux">4.1cBSD</span>.</p>
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">September 15, 2022</td>
<td class="foot-os">FreeBSD 15.0</td>
</tr>
</table>
|