Microsoft KB Archive/101927

= The Lmhosts File for TCP/IP in Windows =

Article ID: 101927

Article Last Modified on 2/20/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Datacenter Server
 * Microsoft Windows NT Workstation 3.5
 * Microsoft Windows NT Workstation 3.51
 * Microsoft Windows NT Workstation 4.0 Developer Edition
 * Microsoft Windows NT Server 3.5
 * Microsoft Windows NT Server 3.51
 * Microsoft Windows NT Server 4.0 Standard Edition

-



This article was previously published under Q101927





SUMMARY
This article describes the Lmhosts file for TCP/IP in Windows.



MORE INFORMATION
The Lmhosts file is a local text file that maps Internet Protocol (IP) addresses to NetBIOS names of remote servers with which you want to communicate over the TCP/IP protocol.

The Lmhosts file is located in the %SystemRoot%\System32\Drivers\Etc folder on a Windows computer. There is also a sample Lmhosts file (Lmhosts.sam) in this folder.

Windows 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 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 is translated to reference the actual IP address of 135.25.25.14 (this is a fictional address).

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 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 following registry key:

HKEY_LOCAL_MACHINE\CurrentControlSet\Services\NetBT\Parameters

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 usually searches through about 1000 entries before it times out (15 seconds).

Additional query words: prodnt maxpreload

Keywords: kbinfo kbnetwork KB101927

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.