1

Context: EC2 testing puts us in a BIND

We're increasingly using amazon ec2 instances for testing.

The one pain point: each time we restart an instance the IP address changes. (static ip's aren't an option as we only have a few addresses and don't need the addresses permanently ).

Our workaround is to have everyone update their '/etc/hosts' with the new IP address, so they can use 'test.cloud.local' for browsing and remote desktop rather than the IP address.

This is OK for developers, but it's harder for qa and other testers. Plus it doesn't scale.

The question

Is there any easy way to have a separate DNS server just for ".cloud.local" domain, to which users can easily add/remove entries, i.e. this usecase:

  • dev/admin restarts an EC2 instance which gets a new iP address
  • dev/admin updates the dns entry for "test.cloud.local"
  • browsers resolve to the correct ip when they browser to "test.cloud.local"

It's still manual work, but only one edit per restart.

IT Department

We're a windows shop and DNS falls squarely in the domain of IT department. I haven't broached the topic yet before gathering data, as the answer is likely to be "NO!". Also, we don't want to open an IT ticket each time we restart an ec2 instance.

Specifically

  • does such an dns app exist? I'm a linux user, but I've never messed with DNS or bind and always think of it as very complex. ideally the dns app would offer a web interface to add/remove ip addresses, rather than ssh and edit a file.
  • how best to broach this with IT

thanks

will

1
  • +1 for "puts us in a BIND"
    – BenGC
    Jul 27, 2011 at 16:43

2 Answers 2

1

You really don't need to do anything manually. Dynamic DNS can be used to handle all of this.

It's easiest (by far) if you've got the cooperation of the IT department, so I'd broach it like this:

  • Write up the business case for the existence and utility of the EC2 servers
  • Describe the costs incurred every time an instance reboots and the IP address changes
    • Be prepared for the question "why don't you just use Elastic IPs?" (that's the first question I'd ask, and I don't understand why you've dismissed them as an option)
  • Include in your request a description of the Dynamic DNS setup you'll need (this could get tricky if you don't know how your organisation does DNS at the moment)
  • Depending on your organisational structure, you'll need to work out where best to inject the request; that could be take it straight to IT, put it into their ticket system, run it through the hierarchy (your boss, boss' boss, up, up, up... then down, down, down... this is why you put it all in writing, to prevent Chinese whispers)

As to exactly what you need to do, technically, it's pretty simple. The DNS servers for the relevant zone (you could call it ec2.example.com if they want a wholly isolated zone) just need to allow TSIG key-secured dynamic DNS updates. You then put a little script into your AMI that, on boot, examines the network config of the instance and sends a DNS update to your DNS servers using the nsupdate tool.

If I were your IT department, I'd still be asking why you're not using Elastic IPs, the damned things are free as long as you're constantly using them (and not rearranging them all the time, which you presumably wouldn't be).

1

Use a VPC, put all your instances in there, and you will have static LAN IP in the subnet of your choice and a much better control over the network ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .