The LHMOSTS File for TCP/IP in Windows NT

Last reviewed: February 16, 1998
Article ID: Q101927

The information in this article applies to:
  • Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, and 4.0

The LMHOSTS file is a local text file that maps IP addresses to NetBIOS names of remote servers with which you want to communicate over the TCP/IP protocol.

NOTE: The Lmhosts file is located in the following folder on a Windows NT computer:

   %SystemRoot%\System32\Drivers\Etc

There is also a sample Lmhosts file in the same folder, which is called Lmhosts.sam.

Windows NT recognizes names instead of IP addresses for network requests and a name discovery process is used to correctly route network requests with TCP/IP. Because the name discovery process is generally not routed by an IP router, the LMHOSTS file allows Windows NT computers to communicate using TCP/IP across a subnet bridged by an IP router.

Under TCP/IP alone, NetBT (NetBIOS over TCP/IP) checks this list in memory before doing a b-node name discovery. For example, a reference to \\Eric would be translated to reference the actual IP address of 135.25.25.14 (this is a fictional address).

A sample LMHOSTS file:

142.25.125.15 Joe #PRE 129.102.12.10 Paul #PRE 148.107.16.45 James 135.25.25.14 Eric #PRE 133.120.26.225 John 192.36.14.250 Ed #PRE 221.250.05.126 Mackey

Note: All addresses are fictional.

When Windows NT loads, it reads the first 100 entries, by default, in the LMHOSTS file marked with #PRE. You can increase the number of #PRE entries that will load into memory at logon by adding the MaxPreLoad entry in the registry. This entry should be added to the Hkey_Local_Machine\CurrentControlSet\Services\NetBT\Parameters section of the registry.

The maximum number allowed for MaxPreLoad depends on the performance of the system. Some computers are able to parse or search through more entries in the LMHOSTS file than others. Based on system performance, Windows NT usually searches through about 1000 entries before timing out (15 seconds).


Additional query words: prodnt maxpreload
Keywords : NTSrvWkst nttcp kbnetwork
Version : 3.1 3.5 3.51 4.0
Platform : winnt


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 16, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.