Resolving UNC path using hosts file

I'm having a problem accessing a UNC path in Windows Server 2008 using the hosts file.

My hosts file looks like:

10.x.x.x     server_1

When trying to access the unc path:

This works:

\\10.x.x.x\data

This doesn't work and says "Windows cannot find \\server_1\data")

\\server_1\data

Does anyone know how to make it resolve the path using a hosts file?


I found this article that explains what you can do to make aliases for localhost's UNC path. I was having a similar problem to the one you are having and did as the article explained, with a succesful result.


Try adding

10.x.x.x     server_1

to %SYSTEM32%\drivers\etc\LMHOSTS

(Note this file doesn't exist by default)

LMHOSTS is to unc paths as HOSTS is to TPC/IP paths.

More info here http://technet.microsoft.com/en-us/library/cc959846.aspx