The LHMOSTS File for TCP/IP in Windows NT

ID: Q101927


The information in this article applies to:

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          : kbnetwork nttcp NTSrvWkst 
Version           : 3.1 3.5 3.51 4.0
Platform          : winnt 
Issue type        : 

Last Reviewed: January 13, 1999