Skip to content

A number of Ruby scripts that work with dnsmadeeasy.com REST API, including a script that when run from an EC2 host registers it's hostname with DNS Made Easy

License

Notifications You must be signed in to change notification settings

bgupta/dnsmadeeasy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

See http://www.dnsmadeeasy.com/enterprisedns/api.html for API documentation. Please note this ruby script is based off the sample perl script provided by DNS Made Easy

For testing, DNS Made Easy is offering sandbox accounts: http://sandbox.dnsmadeeasy.com/

Config File: a file named dnsmeapi.properties must exist in your current directory, with the following contents:
apiKey=ReplaceWithYourAPIKey
secretKey=ReplaceWithYourSecretKey

Files: 
------
README - This document
LICENSE - GPLv2 License
dnsmeapi.rb - Ruby port of DNS Made Easy's sample perl script
dme.rb - Sample script accessing DNS Made Easy's API using entirely native Ruby methods
ec2-set-dme-dns.rb - Registers an EC2 hosts name with DNS Made Easy, if it doesn't exist or if it is set incorrectly
Gemfile.rb - Bundler Gemfile sets up dependencies for ec2-set-dme-dns.rb ("bundle install" to pull in deps)

Usage Examples:

Get a list of domains:
 dnsmeapi.rb http://api.dnsmadeeasy.com/V1.2/domains --header \
 accept:application/json
Get a list of records in a single zone:
 dnsmeapi.rb http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records \
 --header accept:application/json
Get a list of records of a specific record type in a single zone (e.g. - CNAME):
 dnsmeapi.rb \
 http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records?type=cname \
 --header accept:application/json
Get the details of a single record:
 dnsmeapi.rb \
 http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records/recordidnumber \
 --header accept:application/json
Create a new RECORD, where the contents of the file record.txt contains a JSON 
representation of the record (this call will return with the full JSON
including the new recordid):
 dnsmeapi.rb -d @record.txt \
 http://api.dnsmadeeasy.com/V1.2/domains/yourdomain.com/records -X POST \
 --header content-type:application/json

Please note the output JSON is dense. If you would like to make it easier to read you can pipe the output to one of the following tools:
| prettify_json.rb # comes with the json ruby gem ("gem install json")
| python -mjson.tool # comes standard with Python 2.6+
| jazor # A simple commandline JSON parsing tool written in Ruby ("gem install jazor" to install)

About

A number of Ruby scripts that work with dnsmadeeasy.com REST API, including a script that when run from an EC2 host registers it's hostname with DNS Made Easy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages