A simple package to fetch information about a domain's DNS records.
⚠️ Note: This package is a fork of pihvi/dns-info and has been updated to fix security vulnerabilities and to simplify the codebase.
npm install @nerdytechy/dns-info
This fork of dns-info supports both CommonJS and ESM.
const dnsInfo = require("@NerdyTechy/dns-info");
import dnsInfo from '@nerdytechy/dns-info';
dnsInfo("example.com").then((info) => {
console.log(info);
});
dnsInfo({
domain: "example.com",
server: {
address: "8.8.8.8",
port: 53,
type: "udp",
},
timeout: 2000,
})
.then((info) => {
console.log(info);
})
.catch((e) => {
console.error(e); // Request timed out
});
dnsInfo("example.com").then((info) => {
console.log(info.records.find((records) => records.type === "A").data);
});