1HOST.CONF(5)              Linux System Administration             HOST.CONF(5)
2
3
4

NAME

6       host.conf - resolver configuration file
7

DESCRIPTION

9       The  file /etc/host.conf contains configuration information specific to
10       the resolver library.  It should contain one configuration keyword  per
11       line, followed by appropriate configuration information.  The following
12       keywords are recognized:
13
14       trim   This keyword may be listed more than once.  Each time it  should
15              be  followed  by  a  list of domains, separated by colons (':'),
16              semicolons (';') or commas (','), with the  leading  dot.   When
17              set,  the  resolver  library  will  automatically trim the given
18              domain name from the end of any hostname resolved via DNS.  This
19              is  intended  for  use  with  local hosts and domains.  (Related
20              note: trim will not affect hostnames gathered  via  NIS  or  the
21              hosts(5)  file.   Care  should be taken to ensure that the first
22              hostname for each entry in the hosts file is fully qualified  or
23              unqualified, as appropriate for the local installation.)
24
25       multi  Valid values are on and off.  If set to on, the resolver library
26              will return all valid addresses for a host that appears  in  the
27              /etc/hosts  file,  instead  of  only  the  first.  This is on by
28              default.  On systems with DNS, hosts files are much smaller  and
29              the  performance loss of multiple search is negligible. On sites
30              with large hosts files, turning it on may  cause  a  substantial
31              performance loss.
32
33       reorder
34              Valid values are on and off.  If set to on, the resolver library
35              will attempt to reorder host addresses so that  local  addresses
36              (i.e.,  on  the  same subnet) are listed first when a gethostby‐
37              name(3) is performed.  Reordering is done for all  lookup  meth‐
38              ods.  The default value is off.
39

ENVIRONMENT

41       The following environment variables can be used to allow users to over‐
42       ride the behavior which is configured in /etc/host.conf:
43
44       RESOLV_HOST_CONF
45              If set, this variable points to  a  file  that  should  be  read
46              instead of /etc/host.conf.
47
48       RESOLV_MULTI
49              Overrides the multi command.
50
51       RESOLV_REORDER
52              Overrides the reorder command.
53
54       RESOLV_ADD_TRIM_DOMAINS
55              A  list of domains,  separated by colons (':'), semicolons (';')
56              or commas (','), with the leading dot, which will  be  added  to
57              the list of domains that should be trimmed.
58
59       RESOLV_OVERRIDE_TRIM_DOMAINS
60              A  list of domains,  separated by colons (':'), semicolons (';')
61              or commas (','), with the leading dot, which  will  replace  the
62              list of domains that should be trimmed.  Overrides the trim com‐
63              mand.
64

FILES

66       /etc/host.conf
67              Resolver configuration file
68
69       /etc/resolv.conf
70              Resolver configuration file
71
72       /etc/hosts
73              Local hosts database
74

NOTES

76       The following differences exist compared to  the  original  implementa‐
77       tion.    A   new   command   spoof   and  a  new  environment  variable
78       RESOLV_SPOOF_CHECK can take arguments like off, nowarn, and warn.  Line
79       comments can appear anywhere and not only at the beginning of a line.
80
81   Historical
82       The nsswitch.conf(5) file is the modern way of controlling the order of
83       host lookups.
84
85       In glibc 2.4 and earlier, the following keyword is recognized:
86
87       order  This keyword specifies how host lookups are to be performed.  It
88              should  be  followed by one or more lookup methods, separated by
89              commas.  Valid methods are bind, hosts, and nis.
90
91       RESOLV_SERV_ORDER
92              Overrides the order command.
93
94       Since glibc 2.0.7, and up through glibc 2.24,  the  following  keywords
95       and environment variable have been recognized but never implemented:
96
97       nospoof
98              Valid values are on and off.  If set to on, the resolver library
99              will attempt to prevent hostname spoofing to enhance  the  secu‐
100              rity of rlogin and rsh.  It works as follows: after performing a
101              host address lookup, the resolver library will perform  a  host‐
102              name  lookup  for  that  address.   If  the two hostnames do not
103              match, the query fails.  The default value is off.
104
105       spoofalert
106              Valid values are on and off.  If this option is set  to  on  and
107              the  nospoof option is also set, the resolver library will log a
108              warning of the error via the syslog facility.  The default value
109              is off.
110
111       spoof  Valid  values  are off, nowarn, and warn.  If this option is set
112              to off, spoofed addresses are permitted and no warnings will  be
113              emitted via the syslog facility.  If this option is set to warn,
114              the resolver library will attempt to prevent  hostname  spoofing
115              to  enhance  the security and log a warning of the error via the
116              syslog facility.  If this option is set to nowarn, the  resolver
117              library will attempt to prevent hostname spoofing to enhance the
118              security but not emit warnings via the syslog facility.  Setting
119              this option to anything else is equal to setting it to nowarn.
120
121       RESOLV_SPOOF_CHECK
122              Overrides  the  nospoof,  spoofalert,  and spoof commands in the
123              same way as the spoof command is parsed.  Valid values are  off,
124              nowarn, and warn.
125

SEE ALSO

127       gethostbyname(3),  hosts(5),  nsswitch.conf(5),  resolv.conf(5),  host‐
128       name(7), named(8)
129

COLOPHON

131       This page is part of release 4.15 of the Linux  man-pages  project.   A
132       description  of  the project, information about reporting bugs, and the
133       latest    version    of    this    page,    can     be     found     at
134       https://www.kernel.org/doc/man-pages/.
135
136
137
138Linux                             2017-09-15                      HOST.CONF(5)
Impressum