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 would like to set an alias on my local PC for a network machine. I know that it can be done by adding an entry in the hosts file as long as the IP address of the machine is also specified. However, the problem is that IPs are dynamically assigned by a DHCP server so I don't know for sure the IP address. Is there a way to define just an alias based on the machine's network name?

P.S.: I'm running Windows Server 2008 R2.

share|improve this question
up vote 4 down vote accepted

Windows only supports IP to Hostname mapping. You cannot set up local aliases using the hosts file.

If you have control over the DNS for the network, you can create a CNAME record that maps one name to another name.

If you do not have control over the network's DNS - you are out of clean options (barring a frankensteined DNS server running on your localhost just for the creation of your own CNAMEs. shudders)

share|improve this answer
Ok, so my options are as limited as I thought. Thanks for the confirmation. – Alex G. Apr 9 '12 at 19:56

On networks where WINS is enabled/configured, one can refer to another machine by using the network name wherever a hostname is taken, and the OS libraries will map it to the IP address appropriately.

share|improve this answer
Unfortunately WINS is not enabled so I cannot use that but thanks for the suggestion. – Alex G. Apr 9 '12 at 19:56

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.