{
    "mode": "man",
    "parameter": "HOST.CONF",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/man/HOST.CONF/json",
    "generated": "2026-10-23T15:49:43Z",
    "sections": {
        "NAME": {
            "content": "host.conf - resolver configuration file\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  file /etc/host.conf contains configuration information specific to the resolver library.\nIt should contain one configuration keyword per line, followed by  appropriate  configuration\ninformation.  The following keywords are recognized:\n\ntrim   This  keyword may be listed more than once.  Each time it should be followed by a list\nof domains, separated by colons (':'), semicolons (';')  or  commas  (','),  with  the\nleading  dot.  When set, the resolver library will automatically trim the given domain\nname from the end of any hostname resolved via DNS.  This is intended for use with lo‐\ncal hosts and domains.  (Related note: trim will not affect hostnames gathered via NIS\nor the hosts(5) file.  Care should be taken to ensure that the first hostname for each\nentry in the hosts file is fully qualified or unqualified, as appropriate for the  lo‐\ncal installation.)\n\nmulti  Valid values are on and off.  If set to on, the resolver library will return all valid\naddresses  for  a host that appears in the /etc/hosts file, instead of only the first.\nThis is off by default, as it may cause a substantial performance loss at  sites  with\nlarge hosts files.\n\nreorder\nValid  values  are on and off.  If set to on, the resolver library will attempt to re‐\norder host addresses so that local addresses (i.e., on the  same  subnet)  are  listed\nfirst  when  a gethostbyname(3) is performed.  Reordering is done for all lookup meth‐\nods.  The default value is off.\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "The following environment variables can be used to allow users to override the behavior which\nis configured in /etc/host.conf:\n\nRESOLVHOSTCONF\nIf set, this variable points to a file that should be read instead of /etc/host.conf.\n\nRESOLVMULTI\nOverrides the multi command.\n\nRESOLVREORDER\nOverrides the reorder command.\n\nRESOLVADDTRIMDOMAINS\nA list of domains, separated by colons (':'), semicolons (';'), or commas (','),  with\nthe leading dot, which will be added to the list of domains that should be trimmed.\n\nRESOLVOVERRIDETRIMDOMAINS\nA  list of domains, separated by colons (':'), semicolons (';'), or commas (','), with\nthe leading dot, which will replace the list of domains that should be trimmed.  Over‐\nrides the trim command.\n",
            "subsections": []
        },
        "FILES": {
            "content": "/etc/host.conf\nResolver configuration file\n\n/etc/resolv.conf\nResolver configuration file\n\n/etc/hosts\nLocal hosts database\n",
            "subsections": []
        },
        "NOTES": {
            "content": "The following differences exist compared to the original implementation.  A new command spoof\nand a new environment variable RESOLVSPOOFCHECK can take arguments like  off,  nowarn,  and\nwarn.  Line comments can appear anywhere and not only at the beginning of a line.\n",
            "subsections": [
                {
                    "name": "Historical",
                    "content": "The nsswitch.conf(5) file is the modern way of controlling the order of host lookups.\n\nIn glibc 2.4 and earlier, the following keyword is recognized:\n\norder  This keyword specifies how host lookups are to be performed.  It should be followed by\none  or  more lookup methods, separated by commas.  Valid methods are bind, hosts, and\nnis.\n\nRESOLVSERVORDER\nOverrides the order command.\n\nSince glibc 2.0.7, and up through glibc 2.24, the following keywords and environment variable\nhave been recognized but never implemented:\n\nnospoof\nValid values are on and off.  If set to on, the resolver library will attempt to  pre‐\nvent  hostname  spoofing  to enhance the security of rlogin and rsh.  It works as fol‐\nlows: after performing a host address lookup, the  resolver  library  will  perform  a\nhostname lookup for that address.  If the two hostnames do not match, the query fails.\nThe default value is off.\n\nspoofalert\nValid  values  are  on and off.  If this option is set to on and the nospoof option is\nalso set, the resolver library will log a warning of the error via the  syslog  facil‐\nity.  The default value is off.\n\nspoof  Valid  values  are  off,  nowarn, and warn.  If this option is set to off, spoofed ad‐\ndresses are permitted and no warnings will be emitted via  the  syslog  facility.   If\nthis  option  is  set  to  warn, the resolver library will attempt to prevent hostname\nspoofing to enhance the security and log a warning of the error via the syslog  facil‐\nity.   If  this  option is set to nowarn, the resolver library will attempt to prevent\nhostname spoofing to enhance the security but not emit warnings via the syslog  facil‐\nity.  Setting this option to anything else is equal to setting it to nowarn.\n\nRESOLVSPOOFCHECK\nOverrides  the  nospoof,  spoofalert,  and spoof commands in the same way as the spoof\ncommand is parsed.  Valid values are off, nowarn, and warn.\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "gethostbyname(3), hosts(5), nsswitch.conf(5), resolv.conf(5), hostname(7), named(8)\n\nLinux man-pages 6.7                          2023-10-31                                 host.conf(5)",
            "subsections": []
        }
    },
    "summary": "host.conf - resolver configuration file",
    "flags": [],
    "examples": [],
    "see_also": [
        {
            "name": "gethostbyname",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/gethostbyname/3/json"
        },
        {
            "name": "hosts",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/hosts/5/json"
        },
        {
            "name": "nsswitch.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/nsswitch.conf/5/json"
        },
        {
            "name": "resolv.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/resolv.conf/5/json"
        },
        {
            "name": "hostname",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/hostname/7/json"
        },
        {
            "name": "named",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/named/8/json"
        },
        {
            "name": "host.conf",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/host.conf/5/json"
        }
    ]
}