Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:


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


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

share|improve this question

migrated from Jun 22 '11 at 7:37

This question came from our site for professional and enthusiast programmers.

Correct me if I'm wrong, but "server_1" in your \\server_1 example isn't actually a domain name, so it wouldn't go "trough" your hosts file, would it? – Nanne Jun 22 '11 at 6:44

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

share|improve this answer

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.

share|improve this answer
I had the exact same issue, and this worked perfectly for me. Thanks for the link. – Joe Enos Jun 2 '12 at 17:34

Using a hosts file for resolving the hostname?
You might try removing the underscore: change server_1 to server1 or server-1. It used to be that underscores are invalid characters in system and domain names. Perhaps that's changed (although I've yet to see some underscore in the domain part of a website), but give it a try in any case.

share|improve this answer
Hi, I tried removing the underscore but its still not working. I am pretty sure it is not a name problem because I can call webservices with that name. For example: http://server_1/mywebservice/service.asmx works fine. But when using UNC file paths, it doesn't seem to be using the hosts file to resolve the name=/ – FruitDealer Jun 22 '11 at 7:06

You must log in to answer this question.