How to Write an LMHOSTS File for Domain Validation

Last reviewed: February 19, 1998
Article ID: Q180094
The information in this article applies to:
  • Microsoft Windows NT Workstation versions 3.5, 3.51, and 4.0
  • Microsoft Windows NT Server versions 3.5, 3.51, and 4.0
  • Microsoft Windows 95

SUMMARY

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 and domain validation.

MORE INFORMATION

Use the following steps to create a properly formatted Lmhosts file:

  1. Using a text editor, such as Notepad.exe or Edit.com, create a file called Lmhosts and save it in the following folder:

          Windows NT
          ----------
    

          %SystemRoot%\System32\Drivers\Etc
    

          Windows 95
          ----------
    

          C:\Windows (the folder where Windows is installed)
    

    NOTE: The file name is Lmhosts, with no extension. If you are using Notepad.exe it may append .txt automatically. If it does this, you will need to rename the file using no extension at a command prompt.

  2. Add the following entries to the Lmhosts file:

          10.0.0.1   PDCName   #PRE #DOM:Domain
          10.0.0.1   "Domain         \0x1c"   #PRE
          10.0.0.1   "Domain         \0x1b"   #PRE
    
       NOTE: Spacing of these entries is imperative. Replace 10.0.0.1 with the
       IP address of your primary domain controller (PDC), PDCName with the
       NetBIOS name of your PDC, and Domain with your Windows NT domain name.
       There must be a total of 20 characters within the quotations (the domain
       name plus the appropriate number of spaces to pad up to 15 characters
       plus the backslash plus the NetBIOS hex representation of the service
       type).
    
       For more information, see the following article in the Microsoft
       Knowledge base:
    
          ARTICLE-ID: Q163409
          TITLE     : NetBIOS Suffixes (16th Character of the NetBIOS Name)
    
    

  3. After you add the above lines, save the file, and exit the editor.

  4. From a command prompt, type the following and press ENTER:

          nbtstat -R
    

    NOTE: The -R is case sensitive and must be upper case. After typing the above, you should receive the following message:

          Successful purge and preload of the NBT Remote Cache Name Table.
    

  5. Type the following at a command prompt and then press ENTER:

          nbtstat -c
    

    NOTE: The -c is also case sensitive and must be lower case. After typing the above, you should receive a display similar to the following:

          Node IpAddress: [10.0.0.5] Scope Id: []
    

                       NetBIOS Remote Cache Name Table
    
              Name              Type       Host Address    Life [sec
          ----------------------------------------------------------
          PDCName        <03>  UNIQUE      10.0.0.1           -1
          PDCName        <00>  UNIQUE      10.0.0.1           -1
          PDCName        <20>  UNIQUE      10.0.0.1           -1
          Domain         <1C>  UNIQUE      10.0.0.1           -1
          Domain         <1B>  UNIQUE      10.0.0.1           -1
    
    
For more information, see the following article in the Microsoft Knowledge base:

   ARTICLE-ID: Q180099
   TITLE     : Troubleshooting LMHOSTS Name Resolution Issues
Keywords          : NTSrvWkst
Version           : WinNT:3.5,3.51,4.0;Windows:95
Platform          : WINDOWS
Issue type        : kbhowto


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 19, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.