Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
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
3  
@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

1 Answer 1

up vote 6 down vote accepted

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

10.1.1.2 Computer.domain.com Alias1 Alias99

And with that you could ping 10.1.1.2 by "computer.domain.com" "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
1  
that's why I asked if there was a non-hosts method since hosts requires ip –  Maslow Aug 5 '11 at 20:14
3  
@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

Your Answer

 
discard

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.