Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 am doing something a little creative with our server. We are building a preloaded image of our server software. Sometimes our customers ask that we can store the data over a network share, and other customers do not. I was thinking we could get creative, and keep the post install simple.

My idea was, use the windows host file to point at and have a local network share where all the data is stored. In the even that the customer wants us to store on their file server, we just update the host file to the remote server address.

Note -- we have many services so we are trying to do it with as little "reconfiguration" as needed. a host file is at the root of the name resolution so that helps. We could do this manually and not do it this way. We are just wanting to be creative on this.

Server 2008 R2 File Server Role added

Local ServerName: SERVERA  (
Remote ServerName:  SERVERB  (
Host entry name GENERICSERVER     
Folder Shared on local or remote server:   SomeFileShare

\\GENERICSERVER\SomeFileShare -- Passed

\\GENERICSERVER\SomeFileShare -- **Failed**
\\SERVERA\SomeFileShare -- Pass
\\\SomeFileShare -- Pass

\\GENERICSERVER\SomeFileShare -- **Failed**
\\\SomeFileShare -- Pass

Anyone have any idea why setting it up to access a remote server it works fine, but if I point it to the local machine ( or the adapter address), it does not? It prompts me for a user/pass and even shows the system name of the server, but doesn't authenticate.

Any help is appreciated.

share|improve this question
up vote 1 down vote accepted

This is likely caused by a security feature in Windows that (by default) prevents localhost access to names that are not the hostname (CNAME's, or in your case host file custom names). Your results are consistent with what I've experienced.

You need to edit the registry and either add the genericserver name or disable the loopback protection. Here's some info I've collected about it, focused on IIS but also affects SMB.

share|improve this answer

Relying on the hosts file is generally a very poor idea as it leads to all sorts of problems later on when the network changes. I'd suggest using DNS instead. Create a standard host name for your application to use (something so cryptic that it's pretty certain never to clash with a "real" host) and ask clients that wish to use a network share to add a CNAME to point to the intended host. Have your application perform a DNS lookup at startup, testing for the existence of your target host, and use that information if it's valid or fall back to localhost if it's not.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.