lmhosts file

Definition of lmhosts file in The Network Encyclopedia.

Sponsor: The only proven system that really works! Winning Sports Picks & Predictions

What is Lmhosts File?

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.

What is Lmhosts File?

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:  rhino     #PRE #DOM:networking
#net group's DC popular #PRE #source server 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.