Skip to content

Instantly share code, notes, and snippets.

@monde
Created July 17, 2009 20:10
Show Gist options
  • Save monde/149255 to your computer and use it in GitHub Desktop.
Save monde/149255 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'dynect'
# For accessing Dynamic Network Services, Inc. DNS services.
# Use Dynect gem to update a CNAME with an EC2 Private DNS name
# http://rubyforge.org/projects/dynect/
# by Mike Mondragon mikemondragon _AT_ gmail
customer = ENV['DNECT_CUSTOMER']
username = ENV['DNECT_USERNAME']
password = ENV['DNECT_PASSWORD']
begin
d = Dynect.new(customer, username, password)
record = d.list_cname_records("example.com", "node" => "nfs.example.com").first
record_id = record['record_id']
d.update_cname_record(record_id, "record_id" => record_id, "rdata" => { "cname" => "foo.ec2.internal" }).inspect
rescue => err
exit(1)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment