News for hackers. Stuff that matters.
Re:SSH into your EC2 instances with ease by duey on Thursday June 20, 2013 @10:21PM (#5916144)
Could also just name your hosts appropriately and use something like puppet to create and update DNS records for your hosts automatically.
Re:SSH into your EC2 instances with ease by merlincorey on Thursday June 20, 2013 @10:29PM (#5916174)
Yeah, as a neckbearded network and systems engineer I really don't understand this thing at all - it should be a non-issue. Specifically, because the OP states the machines are mostly dedicated machines, there should be absolutely no reason why they don't have dedicated hostnames in DNS, either locally or globally.

At organizations where I have held the above titled roles, DNS was one of first things to be put into service if it had not already been used. Connecting to the IP address of a dedicated machine by a nice name is pretty much what the DNS was invented for. DNS is very much not static and if you are changing a host's IP very often, you can set it up such that the DNS responds appropriately with the proper up to date IP address.

OP's script is nice but... it's solving an already solved problem, IMO.

Re:SSH into your EC2 instances with ease by vacri on Thursday June 20, 2013 @11:04PM (#5916289)
Confused me as well, since this is pretty much what DNS is for - I spent some time trying to figure out the problem being solved...
Re:SSH into your EC2 instances with ease by DrStalker on Thursday June 20, 2013 @11:39PM (#5916389)
The problem is he doesn't know how to use DNS. :-)
Re:SSH into your EC2 instances with ease by hobs on Friday June 21, 2013 @12:37AM (#5916540)
Another great way is to just modify ~/.ssh/config To something like this:

host alias hostName thehostname user your_username

I like the work in the article, but many times when I think I need to whip up a sweet script to fix some problem in the terminal I find the old neckbeards already wrote it, polished it, and left it on the shelf for me to use.

Re:SSH into your EC2 instances with ease by ajdecon on Friday June 21, 2013 @01:02AM (#5916623)
/etc/hosts ?