Need to edit LMhost file so i can access Server through VPN Tunnel

Posted on 2007-08-10
Last Modified: 2013-11-05
I have a 2003 SBS server and I have a sonic wall firewall. I am trying to log in remoteley and have my drive mappings work. When I make the VPN connection outside the office the connection happens, but none of my drive mappings work. So I want to edit the LMhost file on this laptop so it has my SBS server which is at How should it look in the file? I have never edited the Mhost file before so not sure how it should be.
Question by:tkthelpdesk
    LVL 4

    Expert Comment

    It is in \Windows\System32\Drivers\etc directory. Open it with notepad. Add a line to the bottom  Servername
    LVL 4

    Expert Comment

    And it is actually named "hosts" (with no extension) in Windows
    LVL 31

    Expert Comment

    by:Toni Uranjek

    Open file with notepad and add the following line:   servername


    LVL 77

    Accepted Solution

    Depending on how your drive mappings are done, they may not work even with the LMHosts file edited. How is your VPN created?
    -If you are using the Sonicwall VPN client, the tunnel is not available at logon. Therefore the usually drive mapping methods; logon scripts and group policy, are not applied.
    -If you are using the Windows VPN solution you should be able to make this work, but since you have SBS you should have no need of the LMHosts file. However, it is important to create the VPN the "SBS way" using the wizards. This will automatically configure the VPN, firewall, routing, and name resolution. See the following link for details:

    If the remote computer has been joined to the domain, then when you are about to logon to the computer, check the box; "log on using dial-up connection". The VPN connection will be one of the options. Choose that and logon as you normally would. The VPN connection will be established, and then logon takes place but now your logon scripts and drive mappings should work.

    If you do want to work with the LMHosts file, the following may be helpful:
    Setting up an LMHosts file.

    There are a few oddities with the file, have a look at the following:
    -Lmhosts file is useful for NetBIOS name resolution where other solutions are not available.
    -LMHosts is located in the Windows directory under c:\Windows (or WINNT)\System32\Drivers\Etc\LMHosts.sam , instructions are included within the file. Any line starting with # is just a comment and is ignored. Open the file with Notepad and add entries for your computers as below;      CompName       #PRE
    -Hit enter when each line is complete (important), then save the file without a file extension. To be sure there is no extension ,when saving enclose in quotations like "LMHosts".
    -PRE has to be capitalized, however you do not need it, though should give you faster resolution where it is "pre-loaded"
    -use a Tab between entries in a line rather than spaces (recommended but not necessary)
    -if adding the domain and or domain controller the # of spaces used is even critical. See:
    see also:
    ps- To check your LMHosts file entries are accepted at a command prompt enter
      nbtstat  -R
    to purge and reload the local name cache
    then enter
      nbtstat  -c
    to display the current name cache which should include your LMHosts file entries.
    Note; the nbtstat "switches" R & c are case sensitive.
    The names will only show up if you used the 'PRE' option, or if not, if you have used the name with a ping or similar command enabling them to be cached.

    LVL 77

    Expert Comment

    by:Rob Williams
    Thanks tkthelpdesk.
    Cheers !

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I've written this article to illustrate how we can implement a Dynamic Multipoint VPN (DMVPN) with both hub and spokes having a dynamically assigned non-broadcast multiple-access (NBMA) network IP (public IP). Here is the basic setup of DMVPN Pha…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now