Last active
December 7, 2017 14:50
-
-
Save RobinDaugherty/1e22162a076e87e3688e44a70e0239e0 to your computer and use it in GitHub Desktop.
Export zone from Dyn Standard DNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Since Dyn provides no way to export a zone, this extracts the zone data from the "advanced editor" form. | |
// Run this in the console on the editor page, and it will produce a single string. | |
// You may need to clean up the string slightly. Look for hostnames that end with multiple dots and clean those out. | |
dyn_zone_getter = { | |
host: jQuery("#adv_table tr > td:nth-child(1)").map(function(){return $(this).text()}), | |
ttl: jQuery("#adv_table tr > td:nth-child(2) > input").map(function(){return $(this).val()}), | |
type: jQuery("#adv_table tr > td:nth-child(3)").map(function(){return $(this).text()}), | |
data: jQuery("#adv_table tr > td:nth-child(4) > input").map(function(){return $(this).val()}), | |
as_zone: function() { | |
var z = this; | |
if(this.host.length == this.ttl.length && this.host.length == this.type.length && this.host.length == this.data.length) { | |
return Array.prototype.map.call(this.host, function(host, idx) { | |
return [host, z.ttl[idx], z.type[idx].replace(" ", ""), z.data[idx]].join("\t"); | |
}).join("\n"); | |
} else { | |
console.error("Failed, sorry."); | |
} | |
} | |
} | |
dyn_zone_getter.as_zone() |
Thank you so much!
Can this be done for Dyn Standard DNS? I don't see any editor (with or without a console)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks, this is super useful. If you have long record names, running
$("acronym").map(function() { $(this).text($(this).attr('title')); return $(this).attr("title"); })
before the above will allow them to not show up abbreviated.