LMhost - how to create one.

4 PCs in a workgroup.

To speed access up someone said use LMhosts. (xp pro pcs)  I read years ago this is a file that refers fixed ip - to mac address or something like this.  
Is an LM host file a good idea?
Where does the LM hosts files go?

Who is Participating?
Steve KnightConnect With a Mentor IT ConsultancyCommented:
The LMHOSTS file is best used in this way if you preload the details by adding #PRE to the end of the line, e.g.                 pcname                #PRE

But on a small network name resolution should work fine with standard NetBIOS broadcast methods.  For 2000/XP I just to tend to put the entries in HOSTS which is for resolcing TCP/IP addresses whereas LMHOSTS is for NetBIOS names.  The LMHOSTS file usage can also be turned off - go to the properties of tcpip in the properties of your LAN card in network control panel... there is a checkbox in there to enable LMHOSTS lookup.

As said above, Make sure when you save - as the file you select "All files" not "Text files" in the File Type box as otherwise it is likely to add  .TXT to the end. If it is shows as a notepad file or opens straight in notepad when you double click it then the name is wrong -- a filename without an extension will always ask for which application to load it with.

You can test it is working by putting the WRONG address in one of the files against a host, e.g.        dummy


PING dummy

and if the hosts / lmhosts is working then it will try looking for and timeout.

gurutcConnect With a Mentor Commented:
Hi worded,

In a workgroup you don't need lmhosts normally, that's more domain oriented, but it still helps.  You want to edit it and also hosts.  

First, make sure all your machines have a fixed IP.

Go to c:\windows\system32\drivers\etc

In this folder you'll see hosts.sam and lmhosts.sam

The .sam means sample.

Open each of these files and add a line for each workstation that looks like this:  Station1

Where the IP is the address of Station1 or whatever each machine is called and the name is that machine's name.

Then do a Save As for these files, naming them without the .sam part and also change the save as type from text to all files.

Check to see that you now have a hosts and lmhosts files without the .sam extension.  

This will speed up browsing on your small network.

Good Luck!
- gurutc

Moderation in All Things, Especially Moderation.
wordedAuthor Commented:

"For 2000/XP I just to tend to put the entries in HOSTS which is for resolving TCP/IP addresses"

>How do you do that?

One of the PCs is very slow and the "server" sometimes egg times in the group, only sometimes when its being accessed.
Im thinking its got something to do with all this perhaps.
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Steve KnightIT ConsultancyCommented:
I very much doubt slowness would be caused by this.  Once the computer has resolved the address for a workstation or server it is cached.   The HOSTS table entry is the file called HOSTS in the same folder as suggested for the LMHOSTS file above.
wordedAuthor Commented:

ok thanks,

Would you suggest make all IPs static or just the "server" in the workgroup?
Steve KnightIT ConsultancyCommented:
Four four PC's yes I probably would make them static and enter their addresses in HOSTS.  Any more andI'd have a DHCP server, probably the internet router for a small network giving out the addresses and DNS server and default gateway options ... You have to way up possible misconfiguration in static and relative difficulty in changing if needed against a fault with your dhcp server taking the lot offline.... Your choice really and again for four hosts not difficult to amend if needed.
wordedAuthor Commented:

Im thinking static is better ......... Pcs are all in the one room.

Steve KnightIT ConsultancyCommented:
gurutcConnect With a Mentor Commented:
I'm with you guys, static in this small situation is best

- gurutc
gurutcConnect With a Mentor Commented:
Here's another thing you can do that will help.

Under Control Panel open up Network Connections.  Go to the network connection properties on each pc and then the TCPIP properties.  Click the Advanced button.  Click the DNS tab.  Then uncheck the box for Register this connection's addresses in DNS. Click OK and then click OK again.  Now look to see if QoS Packet Scheduler is enabled.  If so, uncheck it.  Then Click the Close button.

The network connections windows should still be open.  If not, reopen it.  Then click Advanced at the top and choose Advanced Settings.  In the listing of Connections make sure your main connection for your small network is at the top of the list.  If not, highlight it and use the arrows to move it to the top.

These small things may help.

- gurutc
wordedAuthor Commented:
Well heres the result after an exhausting day.

I went into "my network places" and found a load of spurious connections from over the years and deleted the lot.
Changed the server share to no space main_pc_docs
Right clicked my computer - map a drive and put the ip address fo the server in. \\\main_pc_docs
Q>I didn’t go for the net use command as after using it I found no drive letter in my computer > anyone know why?

It worked like a dream, at least for now!
They want the PCs cross linked to each others my docs - but I want to see a stable system for at least one working day.

I didnt do the hosts file yet but will test it. - presume it goes on every PC?
Will try this suggestion above
xxx.xxx.x.xxx                 pcname                #PRE
All told my bacon is saved - thanks for everything so far! I like fixing things ...... or should I say we?

Q> Lastly is it risky changing host file remotely, i.e. I may connection during it?
Steve KnightIT ConsultancyCommented:
Q> Lastly is it risky changing host file remotely, i.e. I may connection during it?

None at all.  If it doesn't work change it back, you'll  have the same access as before and machine will have the same IP
wordedAuthor Commented:

I will be reverting back to this issue next week and will report back then
Cool to hear about your job security.  This site's made my job a lot more secure too!

- gurutc
wordedAuthor Commented:

Static IP addreses - done on all 4 pcs – thanks that helped.

At home - I just tested the hosts file, works well – thanks.  
(ignoring the lmhosts as its an XP pro workgroup
x 4 pcs – I hope this is good advise)

I found this ap useful for gathering ip and hostnames …. its free if < 10 hosts
http://www.komodolabs.com/   The XP firewall has to be off to get the IPs.

So I accurately amend the hosts file + each computer gets the same amends (i.e. including it own details …….. no harm it reconfirmed it own details?)

So  …….
xxx.xxx.x.xx2              hostname               #PRE
xxx.xxx.x.xx3              hostname               #PRE
xxx.xxx.x.xx4              hostname               #PRE
xxx.xxx.x.xx5              hostname               #PRE

Topology - 3 of the pcss are wireless and the "server" on the work group is hard wired to the router.

They are complaining of "really slow access" vague but I will be there tomorrow creating amended host files.

There is a share on the "server" / main PC that they all access.

They have big excel docs on it with pics e.g. 20 meg files.  (work around, I will tell them to save locally and resave to share when complete.)

Will 4 of them working on a share with these files seriously affect a wireless G network?
(Ive installed a linksys WRT300n, but Ive G cards as the Ns are expensive, I have one N PCMCIA to test tomorrow)

>>>>>>>>>>> Heres my question.

How can I test bottle necks / network traffic? e.g if all of them have big files open.
Outlook is crashing ….. Ive it set to keep a copy on server and they all collect (sometimes called a multidrop – not exchange)

How can I text the speed of the G cards versus the N?
I need to diagnose whats wrong with the network speed.

For the moment wired is not an option.

Thanks in advance for all the advise so far.

wordedAuthor Commented:

Its been a long year and the resolve has been opening up a bottle of red wine.

Ive pinged
Ive host filed
Ive static ip ed

Thanks for all the help.

The users are 4 females and with a few days off my wounds will heal.

Happy Christmas to you all ............

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.