Super User is a question and answer site for computer enthusiasts and power users. 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 have a production server, on which three different application are running. I need to configure aliases for that server, according to which application needs to be accessed by the user.

How do I set an alias name in the hosts file?

share|improve this question

For adding a alias name to a server in the hosts file you have to make the following structure:

In the first column you have to add the IP-Address, in the second column the host-name and in the third column you have to add the desired alias-name. Any subsequent columns are alias for that host. In the example's second line the IP-Address is for the server and another name for it is test.

For example:       localhost      test   another
share|improve this answer
Default path to hosts file on Windows XP C:\WINDOWS\system32\drivers\etc\hosts – random Sep 15 '09 at 14:13
Based on the question I assumed that the threadstarter is knowing where the hosts-file is. Nevertheless thank you for the addendum :-) – C.Schmalzgruber Sep 15 '09 at 14:17
uh, having two identical names localhost test for differnt IPs can cause headaches... I'll assume a copy&paste error there ;) – brandstaetter Sep 15 '09 at 14:33
thank u but others not able to connect to alias name. – user11222 Sep 15 '09 at 14:43
Yes, you will need to edit the hosts file on each computer that will use the alias; if you want to make this a global change, you need to use a real DNS server. – pkaeding Sep 15 '09 at 15:12

Usually, the Syntax is:

<<IP>> hostname alias1 alias2

example: localhost lo loopback

I hope it works the same under Windows XP

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.