2.2.3.1 Predefined Keywords in LMHOSTS File

The LMHOSTS file can contain predefined keywords that are prefixed with the pound sign (#) character. The following LMHOSTS keywords table lists possible LMHOSTS keywords.

LMHOSTS keyword

Description

#PRE

A tag that can follow the name in an entry. Tagged entries are loaded as permanent entries in the NetBIOS name cache during initialization of the NetBIOS name system. Preloaded entries are used to reduce network broadcasts.

An entry tagged with #PRE, will be loaded in the Local Name Table.

#DOM:DomainName

A tag that can follow the name in an entry. It identifies Domain Controllers for the given domain name.

#INCLUDE Path\FileName

Reads entries in the file Path\FileName. FileName can be a local filesystem path or a Universal Naming Convention (UNC) path as specified in [MS-DTYP] section 2.2.57. There must be entries for the computer names of remote servers hosting the shares in the local LMHOSTS file; otherwise, the shares will not be accessible.

#BEGIN_ALTERNATE and #END_ALTERNATE

A tag defines a list of alternative locations for the LMHOSTS files. This is used as a reliability mechanism. Only one of the files in a #BEGIN/#END block will be used. An attempt is made to read a file, one file at a time.

#MH

A tag that can follow the name of an entry. If present, that name can have multiple IP addresses reflected in multiple entries with the same IP address. This allows the reading of an LMHOSTS file to continue after a successful match of an entry.