How do I set an alias name in the hosts file?
68,156
Solution 1
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 192.168.0.2 is for the server test.server.com and another name for it is test.
For example:
127.0.0.1 localhost test.server.com
192.168.0.2 test.server.com test
192.168.0.3 another.server.com another
Solution 2
Usually, the Syntax is:
<<IP>> hostname alias1 alias2
example:
127.0.0.1 localhost lo loopback
I hope it works the same under Windows XP
Related videos on Youtube
Author by
user11222
Updated on September 17, 2022Comments
-
user11222 almost 2 years
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?
-
Christoph Rüegg almost 15 yearsDefault path to hosts file on Windows XP
C:\WINDOWS\system32\drivers\etc\hosts
-
C.Schmalzgruber almost 15 yearsBased on the question I assumed that the threadstarter is knowing where the hosts-file is. Nevertheless thank you for the addendum :-)
-
brandstaetter almost 15 yearsuh, having two identical names 127.0.0.1 localhost test.server.com 192.168.0.2 test.server.com test for differnt IPs can cause headaches... I'll assume a copy&paste error there ;)
-
user11222 almost 15 yearsthank u but others not able to connect to alias name.