man-pages/man5/host.conf.5.html
2021-03-31 01:06:50 +01:00

323 lines
7.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of HOST.CONF</TITLE>
</HEAD><BODY>
<H1>HOST.CONF</H1>
Section: Linux System Administration (5)<BR>Updated: 2019-03-06<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
host.conf - resolver configuration file
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
The file
<I>/etc/host.conf</I>
contains configuration information specific to the resolver library.
It should contain one configuration keyword per line, followed by
appropriate configuration information.
The following keywords are recognized:
<DL COMPACT>
<DT id="1"><I>trim</I>
<DD>
This keyword may be listed more than once.
Each time it should be
followed by a list of domains, separated by colons (':'), semicolons
(';') or commas (','), with the leading dot.
When set, the
resolver library will automatically trim the given domain name from the
end of any hostname resolved via DNS.
This is intended for use with
local hosts and domains.
(Related note:
<I>trim</I>
will not affect hostnames gathered via NIS or the
<B><A HREF="/cgi-bin/man/man2html?5+hosts">hosts</A></B>(5)
file.
Care should be taken to
ensure that the first hostname for each entry in the hosts file is
fully qualified or unqualified, as appropriate for the local
installation.)
<DT id="2"><I>multi</I>
<DD>
Valid values are
<I>on</I> and <I>off</I>.
If set to
<I>on</I>,
the resolver library will return all valid addresses for a host that
appears in the
<I>/etc/hosts</I>
file,
instead of only the first.
This is
<I>off</I>
by default, as it may cause a substantial performance loss at sites
with large hosts files.
<DT id="3"><I>reorder</I>
<DD>
Valid values are
<I>on</I> and <I>off</I>.
If set to
<I>on</I>,
the resolver library
will attempt to reorder host addresses so that local addresses
(i.e., on the same subnet) are listed first when a
<B><A HREF="/cgi-bin/man/man2html?3+gethostbyname">gethostbyname</A></B>(3)
is performed.
Reordering is done for all lookup methods.
The default value is
<I>off</I>.
</DL>
<A NAME="lbAD">&nbsp;</A>
<H2>ENVIRONMENT</H2>
The following environment variables can be used to allow users to
override the behavior which is configured in
<I>/etc/host.conf</I>:
<DL COMPACT>
<DT id="4"><B>RESOLV_HOST_CONF</B>
<DD>
If set, this variable points to a file that should be read instead of
<I>/etc/host.conf</I>.
<DT id="5"><B>RESOLV_MULTI</B>
<DD>
Overrides the
<I>multi</I>
command.
<DT id="6"><B>RESOLV_REORDER</B>
<DD>
Overrides the
<I>reorder</I>
command.
<DT id="7"><B>RESOLV_ADD_TRIM_DOMAINS</B>
<DD>
A list of domains, separated by colons (':'), semicolons (';') or
commas (','), with the leading dot, which will be added to the list of
domains that should be trimmed.
<DT id="8"><B>RESOLV_OVERRIDE_TRIM_DOMAINS</B>
<DD>
A list of domains, separated by colons (':'), semicolons (';') or
commas (','), with the leading dot, which will replace the list of
domains that should be trimmed.
Overrides the
<I>trim</I>
command.
</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="9"><I>/etc/host.conf</I>
<DD>
Resolver configuration file
<DT id="10"><I>/etc/resolv.conf</I>
<DD>
Resolver configuration file
<DT id="11"><I>/etc/hosts</I>
<DD>
Local hosts database
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>NOTES</H2>
The following differences exist compared to the original implementation.
A new command
<I>spoof</I>
and a new environment variable
<B>RESOLV_SPOOF_CHECK</B>
can take arguments like
<I>off</I>, <I>nowarn</I>, and <I>warn</I>.
Line comments can appear anywhere and not only at the beginning of a line.
<A NAME="lbAG">&nbsp;</A>
<H3>Historical</H3>
The
<B><A HREF="/cgi-bin/man/man2html?5+nsswitch.conf">nsswitch.conf</A></B>(5)
file is the modern way of controlling the order of host lookups.
<P>
In glibc 2.4 and earlier, the following keyword is recognized:
<DL COMPACT>
<DT id="12"><I>order</I>
<DD>
This keyword specifies how host lookups are to be performed.
It should be followed by one or more lookup methods, separated by commas.
Valid methods are
<I>bind</I>, <I>hosts</I>, and <I>nis</I>.
<DT id="13"><B>RESOLV_SERV_ORDER</B>
<DD>
Overrides the
<I>order</I>
command.
</DL>
<P>
Since glibc 2.0.7, and up through glibc 2.24, the following keywords and environment variable have
been recognized but never implemented:
<DL COMPACT>
<DT id="14"><I>nospoof</I>
<DD>
Valid values are
<I>on</I> and <I>off</I>.
If set to
<I>on</I>,
the resolver library will attempt to prevent hostname spoofing to
enhance the security of
<B>rlogin</B> and <B>rsh</B>.
It works as follows: after performing a host address lookup,
the resolver library will perform a hostname lookup for that address.
If the two hostnames
do not match, the query fails.
The default value is
<I>off</I>.
<DT id="15"><I>spoofalert</I>
<DD>
Valid values are
<I>on</I> and <I>off</I>.
If this option is set to
<I>on</I>
and the
<I>nospoof</I>
option is also set,
the resolver library will log a warning of the error via the
syslog facility.
The default value is
<I>off</I>.
<DT id="16"><I>spoof</I>
<DD>
Valid values are
<I>off</I>, <I>nowarn</I>, and <I>warn</I>.
If this option is set to
<I>off</I>,
spoofed addresses are permitted and no warnings will be emitted
via the syslog facility.
If this option is set to
<I>warn</I>,
the resolver library will attempt to prevent hostname spoofing to
enhance the security and log a warning of the error via the syslog
facility.
If this option is set to
<I>nowarn</I>,
the resolver library will attempt to prevent hostname spoofing to
enhance the security but not emit warnings via the syslog facility.
Setting this option to anything else is equal to setting it to
<I>nowarn</I>.
<DT id="17"><B>RESOLV_SPOOF_CHECK</B>
<DD>
Overrides the
<I>nospoof</I>, <I>spoofalert</I>, and <I>spoof</I>
commands in the same way as the
<I>spoof</I>
command is parsed.
Valid values are
<I>off</I>, <I>nowarn</I>, and <I>warn</I>.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+gethostbyname">gethostbyname</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?5+hosts">hosts</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+nsswitch.conf">nsswitch.conf</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?5+resolv.conf">resolv.conf</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?7+hostname">hostname</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?8+named">named</A></B>(8)
<A NAME="lbAI">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="18"><A HREF="#lbAB">NAME</A><DD>
<DT id="19"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DT id="20"><A HREF="#lbAD">ENVIRONMENT</A><DD>
<DT id="21"><A HREF="#lbAE">FILES</A><DD>
<DT id="22"><A HREF="#lbAF">NOTES</A><DD>
<DL>
<DT id="23"><A HREF="#lbAG">Historical</A><DD>
</DL>
<DT id="24"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="25"><A HREF="#lbAI">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:03 GMT, March 31, 2021
</BODY>
</HTML>