• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2033
  • Last Modified:

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

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.
  • 2
  • 2
1 Solution
It is in \Windows\System32\Drivers\etc directory. Open it with notepad. Add a line to the bottom  Servername
And it is actually named "hosts" (with no extension) in Windows
Toni UranjekConsultant/TrainerCommented:

Open file with notepad and add the following line:   servername


Rob WilliamsCommented:
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.

Rob WilliamsCommented:
Thanks tkthelpdesk.
Cheers !

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now