A text file that provides a local method for name resolution of remote NetBIOS names into their respective IP addresses on a TCP/IP network. Using lmhosts files is an alternative to using WINS servers for name resolution on Microsoft Windows–based networks. Using a WINS server is generally preferable because it reduces administrative overhead.
You can find the lmhosts file in the %SystemRoot%\system32\drivers\etc directory in Windows NT and Windows 2000 and in the \Windows directory in Windows 95 and Windows 98.
Each line in the lmhosts file contains the IP address of a NetBIOS computer on the network, followed by the NetBIOS name of the computer. The computer name can be followed by optional prefixes that identify domains and domain controllers and allow entries to be loaded into the NetBIOS name cache at startup. Comments are prefixed with the pound sign (#). Here is an example taken from the sample lmhosts file included with Windows 95:
220.127.116.11 rhino #PRE #DOM:networking
#net group's DC
18.104.22.168 popular #PRE #source server
22.214.171.124 localsrv #PRE #needed for the include
The lmhosts file contains mappings for hosts on remote networks only. Mappings are not required for hosts on local networks because these can be resolved using broadcasts. If you are using lmhosts files to resolve NetBIOS names on a network, each computer on the network should have an lmhosts file.
Place the NetBIOS names that need to be resolved most frequently near the top of the lmhosts file, because the file is parsed linearly from the beginning.