Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@nerdytechy/dns-info

NerdyTechy16ISC1.2.0

Easily fetch all DNS records on a domain with a single high-speed function.

dns, dns-info, dns-records, domains, records, domain-info, promise

readme

dns-info

A simple package to fetch information about a domain's DNS records.

:warning: Note: This package is a fork of pihvi/dns-info and has been updated to fix security vulnerabilities and to simplify the codebase.

Installation

npm install @nerdytechy/dns-info

This fork of dns-info supports both CommonJS and ESM.

CommonJS

const dnsInfo = require("@NerdyTechy/dns-info");

ESM

import dnsInfo from '@nerdytechy/dns-info';

Examples

Simple Request

dnsInfo("example.com").then((info) => {
    console.log(info);
});

Custom Options

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
    });

Filtering Records

dnsInfo("example.com").then((info) => {
    console.log(info.records.find((records) => records.type === "A").data);
});