root-hints
Version:
Provides IP addresses of the DNS root servers, also known as 'root hints'.
19 lines (15 loc) • 348 B
JavaScript
;
const hints = require("./hints.json");
const values = {
A: hints.map(hint => hint.A),
AAAA: hints.map(hint => hint.AAAA),
};
module.exports = function rootHints(type) {
if (values[type]) {
return values[type];
} else if (!type) {
return hints;
} else {
throw new Error(`Unknown record type: ${type}`);
}
};