Microsoft KB Archive/105997

From BetaArchive Wiki
Knowledge Base


Differences Between the HOSTS and LMHOSTS Files in Windows NT

Article ID: 105997

Article Last Modified on 11/1/2006



APPLIES TO

  • Microsoft Windows NT Advanced Server 3.1
  • Microsoft Windows NT Workstation 3.1
  • Microsoft Windows NT Advanced Server 3.1



This article was previously published under Q105997

SUMMARY

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.

MORE INFORMATION

The HOSTS file is used when you do something with the TCP/IP utilities, such as PING, FTP, and TELNET. You can find the HOSTS file in the winnt\system32\drivers\etc directory. The format of the file is the following:

   IP Address     Friendly Name

   130.25.25.87   jsmith_nt   # Remarks are denoted with a #.
                

With an entry like this in the HOSTS file, you could PING jsmith instead of typing out the whole IP address (ping 130.25.25.87). This file is NOT dynamic, so you need to add entries manually.

The LMHOSTS file is for LAN Manager name resolution with the TCP/IP protocol. The file is similar in format to the HOSTS file, but its function is to resolve IP addresses for a server that is not on the local subnet (the same wire). So, if you type the following

   NET VIEW \\JSMITH_NT
                    

and JSMITH_NT is on a different subnet, you will receive a "Server not Found" error message. If you are on a different subnet, edit your LMHOSTS file (in the same directory as the HOSTS file) to read as follows:

   IP Address     Friendly Name

   130.25.25.87   jsmith_nt
                

So when you type "NET VIEW \\JSMITH_NT" (without the quotation marks), the LMHOSTS file tells Windows NT to replace the "\\jsmith_nt" with the IP address to resolve where the server is.

For additional information on the LMHOSTS file in Windows NT, query on the following words in the Microsoft Knowledge Base:

lmhosts and windows and nt



Additional query words: prodnt

Keywords: kbnetwork KB105997