Skip to content

Instantly share code, notes, and snippets.

@fadookie
Last active August 29, 2015 14:26
Show Gist options
  • Save fadookie/300cedf98ca592628e9b to your computer and use it in GitHub Desktop.
Save fadookie/300cedf98ca592628e9b to your computer and use it in GitHub Desktop.
DNS zone file
// Hover.com "Zone file import/export" has been *Planned* since 2011
// https://help.hover.com/entries/471066-Zone-file-import-export
// Here's a brittle approximation of export.
//
// 1. login to your account: https://www.hover.com/domains
// 2. run the following in your browser's JavaScript console, changing the first line
// to your domain
// 3. copy the text logged to the console.
// 4. manually correct FQDNs, these have to end with a period "."
//
// If things go wrong a noisy error should appear in the console; JavaScript debugger might
// stop on the offending code.
var domain = 'tool-man.org'
$.ajax({ type:"GET", url:"/api/dns", success:function(response){
if (response.succeeded) {
//The code below isn't working for some reason:
//var entries = _(response.domains).find(function(d) { return d.domain_name === domain }).entries
var entries = response.domains[0].entries //Hack to just use the first domain as I only have one...
var records = _(entries).map(function(e) { return [e.name, 'IN', e.type, e.content].join(' ') })
var result = "$TTL 900\n" + records.join("\n")
console.log(result)
}
}})
$TTL 900
@ IN TXT v=spf1 include:_spf.google.com ~all
@ IN MX 1 ASPMX.L.GOOGLE.COM.
@ IN MX 5 ALT1.ASPMX.L.GOOGLE.COM.
@ IN MX 5 ALT2.ASPMX.L.GOOGLE.COM.
@ IN MX 10 ASPMX2.GOOGLEMAIL.COM.
@ IN MX 10 ASPMX3.GOOGLEMAIL.COM.
blog IN CNAME toolbear74.wordpress.com.
mail IN CNAME ghs.google.com.
sites IN CNAME ghs.google.com.
docs IN CNAME ghs.google.com.
calendar IN CNAME ghs.google.com.
smtp IN CNAME smtp.gmail.com.
tim IN CNAME toolbear.github.io.
boxen IN CNAME toolbear-boxen.herokuapp.com.
@ IN A 192.30.252.153
@ IN A 192.30.252.154
@ IN TXT keybase-site-verification=pcgVuIGYAkz2Nu5_YeDbzsvG-YiWgi3Ryz9RMlsWMsU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment