How do I automate my usage of three VM machines which require me to add a IP aliased to a name in my HOSTS file. I upload code to the server of choice and then I go to the address http:/ / serverVM/blah and view the program. The basic idea is that I want to be able to add multiple IP addresses in my HOSTS file all with the same alias "serverVM", so that no matter which server I use, I don't have to modify my HOSTS and reboot.
192.168.1.1 serverVM192.168.1.2 serverVM 192.168.1.3 serverVM
You might ask why I don't just do: http:/ / 192.168.1.2/blah? Well it's because the application I use requires the alias "serverVM" because of a cookie and the application won't work correcly otherwise.
The problem is I don't think this is possible with the HOSTS file. Each server is different and I want to chose which one to use at any given time, I can't just use any of them.
Is there a way to solve my dilemma?