Skip to content

Instantly share code, notes, and snippets.

@theeternalsw0rd
Last active February 27, 2018 17:59
Show Gist options
  • Save theeternalsw0rd/9cc494dfb0e93992f04c4d9f5692015c to your computer and use it in GitHub Desktop.
Save theeternalsw0rd/9cc494dfb0e93992f04c4d9f5692015c 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
// 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.
$.ajax({ type:"GET", url:"/api/dns", success:function(response){
if (response.succeeded) {
var domains = response.domains;
var output = "";
$.each(domains, function() {
output += "Zone File for " + this.domain_name + '\n';
output += '$TTL 900\n';
$.each(this.entries, function() {
output += this.name + ' IN ' + this.type + ' ' + this.content + '\n';
});
});
console.log(output);
}
}})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment