Server Fault is a question and answer site for system and network administrators. 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 am setting up in a test environment and need to save some paths in a database but dont want to edit the paths when we go to production. My idea being that I could create a share on both servers and use a generic name like LocalHost instead of TestServer for the paths.


I have used a mapped drive temporarily but was curious if there is another magic word like localhost that works with share paths?

share|improve this question
up vote 1 down vote accepted

We use CNAMES in DNS as a method to create a layer between real server names and an easy to remember name. For example we name servers based on a combination of their role, site, and number, but we use CNAMES so users are able to remember them easily and they never have to remember another name when we migrate to new servers.

Our file server is called ISSFL101, but in DNS we just use "file". So, users are just able to type \file\documents and they are able to access what they need. When we move to a new server we just update the CNAME record to point to the new servers IP address and we are able to cutover in no time and users never know the difference.

Other than that I am not aware of any easy shortcuts.

share|improve this answer
This is a nice solution too but mine is a little different – bugtussle Nov 6 '09 at 15:11

A coworker answered this one: You can use \\\docs instead of a hard coded name.

share|improve this answer
you can also use \\\%computername%\ – bugtussle Nov 6 '09 at 15:24

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.