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?

link|improve this question
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
feedback

migrated from stackoverflow.com Jun 22 '11 at 7:37

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

2 Answers

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.

link|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
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown