ec2dns 2.0: DNS for EC2 instances29 Apr 2015
This post originally appeared under the title “ec2dns 2.0 - DNS for EC2 instances” on April, 29th 2015 on the fruux blog.
EC2 instances have random hostname like ec9-99-99-99-99.compute-1.amazonaws.com. These hostnames are quite hard to remember - that’s where our tool comes into play. All you have to do is to assign
Name tags to your servers, e.g. appserver-1.
Previous versions of ec2dns provided wrapper commands like
Example for the ec2ssh wrapper
$ ec2ssh appserver-1
To make interacting with EC2 instances even easier, we’re going one step further with todays release of ec2dns 2.0, which finally justifies the dns part in the name ec2dns.
Version 2.0 has a built-in DNS server
The wrapper commands are still included, but with the built-in DNS server of ec2dns 2.0 working with EC2 instances is now even better - all you need to know is the
Name tag of the instance and add
.ec2 to it. Amongst various bugfixes and optimizations ec2dns 2.0 has also been migrated to aws/aws-sdk-php v2.
Some usage examples
SSH into an instance via its name tag
$ ssh appserver-1.ec2
Copy a file from an EC2 instance onto your machine
$ scp email@example.com:/etc/nginx/nginx.conf .
There are a few prerequisites, but aside from them setting up ec2dns is done with just one command.
$ composer global require "fruux/ec2dns=~2.0.0"
If you want to use the DNS feature, you’ll just have to make sure that the ec2dns server is running on your system (we have instructions for OS X) and used to resolve anything with the
Open source at fruux
fruux is powered by a ton of open source software, but we also release a lot of open source software ourselves. ec2dns is really just a tiny example. With sabre/dav and our other sabre/* projects all of our core technology is open source, too and heavily used not just in our own product, but also powers sync features in great products from companies such as Atmail, Box and ownCloud.
I hope that ec2dns (or any of our other open source projects) will be useful for you. Perhaps we’ll even see you as a contributor on GitHub soon. :-)