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

Same question as How to I alias a hostname?

but for windows, particularly windows 7

I don't want to specify an ip address (hosts file) just an alias so that \\mylaptop points to \\longcomputername and all programs will be able to find it should I use that dns

share|improve this question
Have you tried just editing the hosts file (in C:\windows\system32\drivers\etc) with just "longcomputername mylaptop"? – Mike Keller Aug 5 '11 at 17:09
@MikeKeller - The OP specifically said he didn't want to use the hosts file, and the hosts file (as I understand it, at least) only works on a name-to-IP basis - it can't deal with name-to-name associations. – Iszi Aug 5 '11 at 17:14
I'm very interested in seeing an answer to this. One problem that I've run into recently is trying to map the same network location more than once - Windows won't let you do it. You can map it twice by using the name for the first one, and the IP for the second. If there is a way to alias names, one might be able to map the same network location a bunch of times. – Fopedush Aug 5 '11 at 18:30
up vote 12 down vote accepted

HOSTS is only for giving names to IP addresses. So you can so something like: Alias1 Alias99

And with that you could ping by "" "alias1" or "alias99".

But you can't do

Computer Alias1 Alias99

To do it by host names only (I.E. the target host is on a dynamic IP), then you need a DNS server (assuming dynamic IP on target host, then you'll need one that keeps up to date with the host's changing IP).

In the DNS server you'd set alias entries ("CNAME" records) that point to the target machine's Host entry ("A" record).

share|improve this answer
that's why I asked if there was a non-hosts method since hosts requires ip – Maslow Aug 5 '11 at 20:14
@Maslow - Yup, and the root of the answer is, "use DNS". :) I just wanted to expand the answer to include why HOSTS can't do this (for future visitors). – Ƭᴇcʜιᴇ007 Aug 5 '11 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .