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 off by
28              default, as it may cause a substantial performance loss at sites
29              with large hosts files.
30
31       reorder
32              Valid values are on and off.  If set to on, the resolver library
33              will attempt to reorder host addresses so that  local  addresses
34              (i.e.,  on  the  same subnet) are listed first when a gethostby‐
35              name(3) is performed.  Reordering is done for all  lookup  meth‐
36              ods.  The default value is off.
37

ENVIRONMENT

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

FILES

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

NOTES

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

SEE ALSO

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

COLOPHON

129       This page is part of release 5.07 of the Linux  man-pages  project.   A
130       description  of  the project, information about reporting bugs, and the
131       latest    version    of    this    page,    can     be     found     at
132       https://www.kernel.org/doc/man-pages/.
133
134
135
136Linux                             2019-03-06                      HOST.CONF(5)
Impressum