Tuesday, 27 November 2007

for when you network shares are slow... lmhosts

LMHosts has existed in Windows for ever. Well I know it has since Windows ME anyhow. It's a file thats actually very rarely used by Windows. Infact most people don't even have one. So why am I talking about a mythical file that no one uses... Well that's because sometimes it is needed and useful. Here at home I have a nice Linksys NSLU-2 or SLUG as its known. This is running the very nice UnSlung firmware and as well as providing Samba shares it has an FTP server, twonkymedia and some other bits and pieces on it. Overall it's very good and keeps me very happy. However one thing really frustrates me about it. Accessing the Samba file shares are really slow in XP and Vista. Especially slow in XP. I thought that my poor slug may have been being over worked and even that the HDD attached to it could be experiencing some issues. Luckily I decided to do some research before doing anything drastic and I stumbled on a really interesting find. I cant find the forum thread I was reading, it was on the Linksys ones, but a user had suggested that Window Networking can struggle with the device and a way to speed it up is to create / append to the lmhosts file an entry for your device. This means that your box needs to be on a static IP address, but let's be honest this isn't a bad thing. So I went to C:\WINDOWS\system32\drivers\etc and created myself a new lmhosts file. Then by consulting our good friend wikipedia added the following line...

192.168.2.3    mjjamesSlug           #PRE             #SLUG
So i have my ip adress for my slug, the network alias, #pre so it caches it as i use this drive alot and then a nice comment at the end saying what this is for. I wasnt sure if I expected this to improve the speed of my shares but it did amazingly. Straight away everything loaded faster, explorer wouldnt have a good long think everytime i changed folders, my slug was usable again. So now I am going to add this change to all the comps on our home network and reap the benefits. Now the question is will normal windows file shares behave better if each comp has an entry in each other comps lmhosts file, I'm unsure of this but I may give it a go, it wont be that hard to set up 3 comps on static ip's .... Anyhow if you are experiencing slow network shares, especially on a nas or similar device then why not try lmhosts. You may even love it ;)

No comments: