CONTRIBUTING.d/patches: Please provide a git-range-diff(1)
[man-pages.git] / man5 / host.conf.5
blob1f88665bc74ece44e1e16f81ff4b7fe730ecdc47
1 .\" Copyright (c) 1997 Martin Schulze (joey@infodrom.north.de)
2 .\" Much of the text is copied from the manpage of resolv+(8).
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" 2003-08-23 Martin Schulze <joey@infodrom.org> Updated according to glibc 2.3.2
7 .TH host.conf 5 (date) "Linux man-pages (unreleased)"
8 .SH NAME
9 host.conf \- resolver configuration file
10 .SH DESCRIPTION
11 The file
12 .I /etc/host.conf
13 contains configuration information specific to the resolver library.
14 It should contain one configuration keyword per line, followed by
15 appropriate configuration information.
16 The following keywords are recognized:
17 .TP
18 .I trim
19 This keyword may be listed more than once.
20 Each time it should be
21 followed by a list of domains, separated by colons (\[aq]:\[aq]), semicolons
22 (\[aq];\[aq]) or commas (\[aq],\[aq]), with the leading dot.
23 When set, the
24 resolver library will automatically trim the given domain name from the
25 end of any hostname resolved via DNS.
26 This is intended for use with
27 local hosts and domains.
28 (Related note:
29 .I trim
30 will not affect hostnames gathered via NIS or the
31 .BR hosts (5)
32 file.
33 Care should be taken to
34 ensure that the first hostname for each entry in the hosts file is
35 fully qualified or unqualified, as appropriate for the local
36 installation.)
37 .TP
38 .I multi
39 Valid values are
40 .IR on " and " off .
41 If set to
42 .IR on ,
43 the resolver library will return all valid addresses for a host that
44 appears in the
45 .I /etc/hosts
46 file,
47 instead of only the first.
48 This is
49 .I off
50 by default, as it may cause a substantial performance loss at sites
51 with large hosts files.
52 .TP
53 .I reorder
54 Valid values are
55 .IR on " and " off .
56 If set to
57 .IR on ,
58 the resolver library
59 will attempt to reorder host addresses so that local addresses
60 (i.e., on the same subnet) are listed first when a
61 .BR gethostbyname (3)
62 is performed.
63 Reordering is done for all lookup methods.
64 The default value is
65 .IR off .
66 .SH ENVIRONMENT
67 The following environment variables can be used to allow users to
68 override the behavior which is configured in
69 .IR /etc/host.conf :
70 .TP
71 .B RESOLV_HOST_CONF
72 If set, this variable points to a file that should be read instead of
73 .IR /etc/host.conf .
74 .TP
75 .B RESOLV_MULTI
76 Overrides the
77 .I multi
78 command.
79 .TP
80 .B RESOLV_REORDER
81 Overrides the
82 .I reorder
83 command.
84 .TP
85 .B RESOLV_ADD_TRIM_DOMAINS
86 A list of domains,
87 separated by
88 colons (\[aq]:\[aq]), semicolons (\[aq];\[aq]), or commas (\[aq],\[aq]),
89 with the leading dot,
90 which will be added to the list of domains that should be trimmed.
91 .TP
92 .B RESOLV_OVERRIDE_TRIM_DOMAINS
93 A list of domains,
94 separated by
95 colons (\[aq]:\[aq]), semicolons (\[aq];\[aq]), or commas (\[aq],\[aq]),
96 with the leading dot,
97 which will replace the list of domains that should be trimmed.
98 Overrides the
99 .I trim
100 command.
101 .SH FILES
103 .I /etc/host.conf
104 Resolver configuration file
106 .I /etc/resolv.conf
107 Resolver configuration file
109 .I /etc/hosts
110 Local hosts database
111 .SH NOTES
112 The following differences exist compared to the original implementation.
113 A new command
114 .I spoof
115 and a new environment variable
116 .B RESOLV_SPOOF_CHECK
117 can take arguments like
118 .IR off ", " nowarn ", and " warn .
119 Line comments can appear anywhere and not only at the beginning of a line.
120 .SS Historical
122 .BR nsswitch.conf (5)
123 file is the modern way of controlling the order of host lookups.
125 In glibc 2.4 and earlier, the following keyword is recognized:
127 .I order
128 This keyword specifies how host lookups are to be performed.
129 It should be followed by one or more lookup methods, separated by commas.
130 Valid methods are
131 .IR bind ", " hosts ", and " nis .
133 .B RESOLV_SERV_ORDER
134 Overrides the
135 .I order
136 command.
138 .\" commit 7d68cdaa4f748e87ee921f587ee2d483db624b3d
139 Since glibc 2.0.7, and up through glibc 2.24,
140 the following keywords and environment variable
141 have been recognized but never implemented:
143 .I nospoof
144 Valid values are
145 .IR on " and " off .
146 If set to
147 .IR on ,
148 the resolver library will attempt to prevent hostname spoofing to
149 enhance the security of
150 .BR rlogin " and " rsh .
151 It works as follows: after performing a host address lookup,
152 the resolver library will perform a hostname lookup for that address.
153 If the two hostnames
154 do not match, the query fails.
155 The default value is
156 .IR off .
158 .I spoofalert
159 Valid values are
160 .IR on " and " off .
161 If this option is set to
162 .I on
163 and the
164 .I nospoof
165 option is also set,
166 the resolver library will log a warning of the error via the
167 syslog facility.
168 The default value is
169 .IR off .
171 .I spoof
172 Valid values are
173 .IR off ", " nowarn ", and " warn .
174 If this option is set to
175 .IR off ,
176 spoofed addresses are permitted and no warnings will be emitted
177 via the syslog facility.
178 If this option is set to
179 .IR warn ,
180 the resolver library will attempt to prevent hostname spoofing to
181 enhance the security and log a warning of the error via the syslog
182 facility.
183 If this option is set to
184 .IR nowarn ,
185 the resolver library will attempt to prevent hostname spoofing to
186 enhance the security but not emit warnings via the syslog facility.
187 Setting this option to anything else is equal to setting it to
188 .IR nowarn .
190 .B RESOLV_SPOOF_CHECK
191 Overrides the
192 .IR nospoof ", " spoofalert ", and " spoof
193 commands in the same way as the
194 .I spoof
195 command is parsed.
196 Valid values are
197 .IR off ", " nowarn ", and " warn .
198 .SH SEE ALSO
199 .BR gethostbyname (3),
200 .BR hosts (5),
201 .BR nsswitch.conf (5),
202 .BR resolv.conf (5),
203 .BR hostname (7),
204 .BR named (8)