As of version v0.8.7, pkgcloud now supports Rackspace Cloud DNS. By itself, this isn't particularly newsworthy, however, when you consider that Rackspace Cloud DNS is currently a free DNS service (you only need to have a Rackspace Cloud account) that you realize the impact adding this to pkgcloud has.
DNS is designed to help abstract away the specific IP address or provider generated CNAMEs, and Rackspace Cloud DNS allows you to do this at no extra cost.
Creating DNS records for your cloud assets has always been an important part of a provisioning platform for any cloud based application. Consider the resources you need to manage when you're using load balancers, spinning up and tearing down new compute instances, utilizingΒ multiple network interfaces per instance,Β and even leveraging multiple datastores and provisioning regions.
When I was helping build Clipboard's* infrastructure, we created DNS records for the public and private interfaces of every compute instance whenever we brought up new instances, for example: web-03.private.prod.clipboard.com and riak-07.stage.clipboard.com. We also used DNS for our load balancers, our work queues, and even external services that we depended on.
Considering the price (free!), and how easy node.js integrates with web APIs, there was no reason to not leverage the awesome service. Now that we've added it toΒ pkgcloud it's even easier!
In this example, I'll show you how to add a Zone to your cloud account, and create a record with pkgcloud and node.js
var pkgcloud = require('pkgcloud'), config = require('./my-config.json'); var client = pkgcloud.providers.rackspace.dns.createClient(config); client.createZone({ name: 'mydomain.com', // the domain to use for the zone email: '[email protected]' // this is the SOA contact email address }, function(err, zone) { // handle your errors appropriately in your application if (err) { console.dir(err); return; } zone.createRecord({ name: 'www.mydomain.com', data: '192.168.0.1', type: 'A' }, function(err, record) { if (err) { console.dir(err); return; } // use your newly created record here }); });
As you can see, creating a zone and adding a record to the zone is very straightforward. You can read more about the records interface and zones interface for Cloud DNS on github.
Clipboard was a small social media startup I joined in 2011 before I joined Rackspace. Clipboard was later acquired by Salesforce.com and has since been shut down.