What is the lmhosts file and what does it do?
The lmhosts file is a text file that maps Internet Protocol (IP) addresses to NetBIOS names of remote servers with which you wish to communicate over the TCP/IP protocol. The lmhosts file is located in the %SystemRoot%\System32\drivers\etc folder. By default %SystemRoot% is "C:\\Windows". Here you will find a sample lmhosts file, lmhosts.sam, and a sample hosts file, hosts.sam. If any mappings have been created you will find the lmhosts file and possibly a hosts file, neither having an extension. The hosts file contains IP address to Domain Name mappings for TCP/IP. Domain Names and NetBIOS names should be the same, but because they can be configured in two different locations, conflicts can arise. Therefore, IP mappings should be stored in the lmhosts file because this is the file that Windows checks first when resolving any name, be it NetBIOS or Domain.
How does this information apply to the Intelli-Site software?
Intelli-Site references all computers by name, not address. Therefore, it is mandatory that a method to resolve those names to IP address exists. Commonly, installations do not have DNS servers. A properly configured lmhosts file solves this issue. In addition, a properly configured lmhosts file provides a significant performance enhancement. Having the names of the Server and Workstations in the file speeds up the resolution process because this file is checked before it queries the DNS server. Also, even when a network has a DNS server, it is not uncommon for it to be improperly configured or missing or unreachable. A missing or improperly configured DNS server will prevent the Workstation and Server from communicating.
How do I properly configure my lmhosts file?
Every Windows computer in the Intelli-Site system must have a properly configured lmhosts file. Luckily, configuring the lmhosts file is rather straight forward.
- Browse to the %SystemRoot%\System32\drivers\etc folder
- If there is not an lmhosts file, copy lmhosts.sam to lmhosts
- Open the lmhosts file with "Notepad" either by double-clicking and choosing Notepad from the list, or by right-clicking and select "Open with..." then selecting Notepad.
- Add a mapping for each computer in the Intelli-Site system in the following way:
<IP Address> <Name> #PRE
For example:
"192.168.1.50 ISServer #PRE" - Save the file. Windows7 or Windows Server 2008 R2 may require you to save the file in an alternate location (i.e., the Desktop) and then copy the file. This is because of the UAC protections.
- Reboot the computer.
- Repeat these steps on each computer in the Intelli-Site system.
As the lmhosts file header states, the whole file is parsed including comments on each lookup. So it is important to keep comments to a minimum and it is advisable to insert the mappings at the top of the file if there are a lot of names or a lot of activity.