lmhosts.sam - what is this file?

Lmhosts.sam - what kind of file? Lmhosts is a local hosts file used by Microsoft Wins Clients, which maps IP addresses to NT computer names (NetBIOS names). The content of Lmhosts.sam changes if the user cannot access or is having difficulty with the DNS server.

One of the security measures taken by Microsoft to protect Windows Vista and Windows 7 from malware was that it was more difficult to edit the lmhosts and hosts files. In older versions of the operating system, malicious code could modify these files, resulting in a PC infection. Many novice users wonder: β€œLmhosts.sam - what is it?”. We will try to answer it.

Lmhosts.sam file - what is it and what does it do?

lmhosts is a text file that maps Internet Protocol (IP) addresses to the names of the remote NetBIOS servers that the user communicates with over TCP / IP. The lmhosts file is located in the% SystemRoot% \ System32 \ drivers \ etc folder. The hosts file contains the IP address for domain name mappings for TCP / IP. Domain names and NetBIOS names must be the same, but since they can be configured in two different places, conflicts can occur. Therefore, IP mappings must be stored in the lmhosts file, since this file was originally

lmhosts sam what is it
Windows checks when resolving any name, be it NetBIOS or Domain.

How to find and edit lmhosts.sam?

Find and open the file. Since it can be located in different places, it is usually easiest to open a search in Windows and search for the lmhosts.sam file.

For users who manually search for the location of the file, the following is a list of Microsoft Windows versions and the location of the lmhosts file:

  • XP, Vista, 7 and 8 - C: \ Windows \ System32 \ Drivers \ Etc;
  • 2000 - C: \ WINNT \ System32 \ Drivers \ Etc;
  • 98 and ME - C: \ Windows \.

After the file has been found, right-click on the icon and select "Open with ...", in response to the invitation, select "Select a program from the list" and click OK. In the list of programs used to open the file, scroll to the bottom of the list, select WordPad or your preferred text editor and click OK.

Lmhosts.sam - what kind of file?

By default, the lmhosts file already contains data, such as comments and examples similar to the ones below:

  • 127.0.0.1 localhost # - an example of a local host;
  • 4.7.5.3 example # - an example of a fake IP address and name.

The two lines above have an IP address, a NetBIOS name, and a note # for that line. Localhost and example are NetBIOS names.

If you are using Windows Vista, 7 or 8 dthcb., You may receive a "denied access" error when trying to save changes to the lmhost file. This error occurs when your text editor does not have administrator rights. To solve this problem, run Notepad or WordPad as an administrator.

lmhosts sam what kind of file

Lmhosts.sam file - what is it? LMHosts is designed specifically for Microsoft-based networks. If you associate DNS with the hosts file, LMhosts is equivalent to WINS. This allows you to understand who is the domain controller and which domain is being viewed.

User manual

Creating and editing entries in Lmhosts.sam - what is it? Use the following rules to work with data in this file:

  1. The entry consists of the IP address of the computer, followed by at least one tab and the NetBIOS name of the computer.
  2. You cannot add an LMHOSTS entry for a computer that is a DHCP client because the IP addresses of DHCP clients change dynamically. To avoid problems, make sure that the computers whose names are entered in the LMHOSTS files are configured for static IP addresses.
  3. Each entry should be a separate line.
  4. NetBIOS names can contain upper and lower case characters and special characters.
  5. Each NetBIOS name is 16 bytes long. The user-defined part of the NetBIOS name is the first 15 characters. By default, the 16th character is set to identify the network client service that registered this name.

content lmhosts sam

The most familiar example of a NetBIOS name is the name of a computer on any Windows computer. When the computer is started, Microsoft Network Client services are started and their names are registered, which consist of the computer name plus a unique 16th character. For example, the name <computer name [0x00]> is a Microsoft Workstation service; name <computer name [0x20]> is the Microsoft Server service. As you can see, the only difference between these two names is the 16th character, which allows you to uniquely identify each of the network client services running on the computer.

Source: https://habr.com/ru/post/C14382/


All Articles