This article was previously published under Q101927
This article describes the Lmhosts file for TCP/IP in Windows.
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 networkrequests and a name discovery process is used to correctly routenetwork requests with TCP/IP. Because the name discovery process isgenerally not routed by an IP router, the Lmhosts file allows Windows computers to communicate using TCP/IP across a subnet bridged by anIP router.
Under TCP/IP alone, NetBT (NetBIOS over TCP/IP) checks this list inmemory before doing a b-node name discovery. For example, a referenceto \\Eric is translated to reference the actual IP address of220.127.116.11 (this is a fictional address).
Sample Lmhosts File
18.104.22.168 Joe #PRE 22.214.171.124 Paul #PRE 126.96.36.199 James 188.8.131.52 Eric #PRE 184.108.40.206 John 220.127.116.11 Ed #PRE 221.250.05.126 Mackey
NOTE: All addresses are fictional.
When Windows loads, it reads the first 100 entries, by default, inthe Lmhosts file marked with #PRE. You can increase the number of #PREentries that will load into memory at logon by adding the MaxPreLoadentry in the registry. This entry should be added to the following registry key:
The maximum number allowed for MaxPreLoad depends on the performanceof the system. Some computers are able to parse or search through moreentries in the Lmhosts file than others. Based on system performance,Windows usually searches through about 1000 entries before it times out (15 seconds).