LMHOSTS
The LMHOSTS file looks exactly like a hosts file and functions in a similar way. The difference is that the LMHOSTS file maps NetBIOS names to IP addresses, and the hosts file maps TCP/IP host names to IP addresses. A sample LMHOSTS file shows how similar these two files look:
172.16.6.16 anubis 172.16.6.10 thor 172.16.6.7 theodore
Each entry in an LMHOSTS file contains an IP address that is separated by whitespace from the NetBIOS name associated with that address. An entry must not exceed a single line and comments begin with the pound sign (#). The LMHOSTS file is stored in the %SystemRoot%\system32\drivers\etc directory.
The LMHOSTS file does have some features that are not supported by the host file. These special commands begin with pound signs (#) so that older Microsoft operating systems will treat them as comments, allowing the same file to be used on both NT systems and older operating systems. The NT commands are:
#PRECauses the entry to be pre-loaded into the cache and permanently retained there. Normally entries are only cached when they are used for name resolution and are only retained in the cache for a few minutes. Use
#PREto speed up address resolution for frequently used host names.#DOM:domainIdentifies NT domain controllers. The
variable is the name of the NT domain for which this system is a controller. Every domain controller in the LMHOSTS file should be identified by adomain#DOMcommand. If you don’t use NT domains, this command is not needed.#INCLUDE ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access