- The Windows 2000\XP\.NET Resource Index
Home | About Us | Search

Last Updated December 16, 2003

Windows 2000
Windows XP
Book Reviews
Career Tools
Device Drivers
Hardware Guides
MCSE Toolkit
  Networking Basics
  Networking Books
  Network Mgmt
  Network Monitoring
  Browser Service
  OSI Model
Service Packs




The LMHOSTS file is a static file that assists with remote NetBIOS name resolution on computers that cannot respond to NetBIOS name-query broadcasts. It contains NetBIOS name-to-IP addresses mappings. You can find a sample file in the %systemroot%\system32\drivers\etc directory in Windows 2000. The file is named LMHOSTS.SAM, and must be renamed to LMHOSTS before it can be used. It is important to remember that since an LMHOSTS file contains a static computer name to IP address mapping, it may cause conflicts if you are also using DHCP to dynamically assign IP addresses on the same network.

Where to start
LMHOSTS File for TCP/IP in Windows NT/2000
Microsoft Knowledge Base Article: 101927 - The LHMOSTS File for TCP/IP in Windows NT/2000 is a local text file (located in %SystemRoot%\System32\Drivers\Etc) that maps IP addresses to NetBIOS names of remote servers with which you want to communicate over the TCP/IP protocol.

Rules for LMHOSTS files 
Guidelines for making sure your LMHOSTS files follow the proper Microsoft format. Source: MSDN

Troubleshooting LMHOSTS Name Resolution Issues  
Microsoft Knowledge Base Article: 180099 - When you attempt to load the contents of an Lmhosts file into the NetBIOS Remote Cache Name Table using the Nbtstat -R command, you may notice that the entries are not loading. You can view this by using the Nbtstat -c command.


Connecting to NetBIOS Resources Using DNS Names or IP Addresses
Microsoft Knowledge Base Article: 161431 - Windows NT 4.0 and Windows 2000 allow you to use Domain Name System (DNS) to resolve a computer name to an IP address for Windows networking functions, or to connect directly to an IP address without knowing the NetBIOS name.

Difference between HOSTS and LMHOSTS file in Windows NT
Microsoft Knowledge Base Article 105997 In Windows NT, the HOSTS file is for TCP/IP utilities, and the LMHOSTS file is for LAN Manager NET utilities. If you cannot PING another computer (using a friendly name), check the HOSTS file. If you cannot NET VIEW a server using only the TCP/IP protocol, check the LMHOSTS file.

How to Write an LMHOSTS File for Domain Validation and Other Name Resolution Issues  
Microsoft Knowledge Base Article: 180094 - There may be instances when you are experiencing name resolution issues on your TCP/IP network and you need to use Lmhosts files to resolve NetBIOS names. This article discusses the proper method of creating an Lmhosts file to aid in name resolution.

LMHOSTS #Include Directives Requires Null Session Support 
Microsoft Knowledgebase Article Q121281 - In order for #INCLUDE directives in an LMHOSTS file to succeed at startup time, the referenced system(s) shares must support "null sessions". Null sessions are those where the user credentials passed in the Session Setup SMB are null.

LMHOSTS File Information and Predefined Keywords
Microsoft Knowledge Base Article: 102725 - LMHOSTS File Information and Predefined Keywords The LMHOSTS file is a local text file that maps IP addresses to NetBIOS names of remote servers with which you want to communicate over the TCP/IP protocol. Windows NT 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 NT machines to communicate using TCP/IP across a subnet.

LMHOSTS Keywords Must Be Uppercase 
Microsoft Knowledge Base Article: 110976 - Keyword entries in the LMHOSTS files of Microsoft Windows NT systems must be entered in uppercase to be recognized. If the keywords #INCLUDE and #PRE are not uppercase, they are considered to be comments.

NetBIOS Name Resolution Using DNS and the HOSTS File
Microsoft Knowledge Base Article: 142309 - NetBIOS Name Resolution Using DNS and the HOSTS File

More LMHOSTS Tips 
Great article by Mark Minasi

Primary Domain Controller (PDC) Names Entered in LMHOSTS File Are Case-Sensitive
Microsoft Knowledge Base Article: 262655 - A preloaded entry for the primary domain controllers (PDCs) (Domainname<1B>) in the NetBT (NetBIOS over TCP/IP) cache is not recognized. Even though Domainname<1B> seems to be loaded in the NetBT cache, the computer still queries for that name.

Using the LMHOSTS file to backup WINS 
In addition to resolving NetBIOS names for small networks, the LMHOSTS file can be used to back up WINS. Since the cached entries are referred to first, you can manually reset the cache of a corrupt or missing domain by reloading the entries in the LMHOSTS file. Source:



Entire contents
© 1999-2003 and TechTarget
All rights reserved

This site and its contents are Copyright 1999-2003 by Microsoft, NT, BackOffice, MCSE, and Windows are registered trademarks of Microsoft Corporation. Microsoft Corporation in no way endorses or is affiliated with The products referenced in this site are provided by parties other than makes no representations regarding either the products or any information about the products. Any questions, complaints, or claims regarding the products must be directed to the appropriate manufacturer or vendor.