New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dns-dig

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dns-dig

DNS package which works similar to native DNS package of Node but internally using dig for fast updations

  • 1.3.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
99
decreased by-43.43%
Maintainers
1
Weekly downloads
 
Created
Source

dns-dig

DNS package which works similar to native DNS package of Node but internally using dig for fast updations

Installation

npm install dns-dig --save

Usage

var dns = require('dns-dig')()

dns.resolveIp4('example.com').then(ip4 => {
  console.log(ip4); // ["93.184.216.34"]
});

API

Initialize

The module exposes an object with different function which can be called with an optional options object:

var dns = require('dns-dig');

The options are:

  • host (Optional) - If not set then will automatically utilize available host for query. Otherwise when an IP of any DNS provider is supplied, then it queries that specific host.
dns.resolveIp4(domainName, {host: '1.1.1.1'})

Takes a string and returns an array of IPv4 addresses associated with the supplied domain if any.

dns.resolveCname(domainName, {host: '1.1.1.1'})

Takes a string and returns an array of CNAME Records associated with the supplied domain if any.

dns.resolveMx(domainName, {host: '1.1.1.1'})

Takes a string and returns an array of MX Records associated with the supplied domain if any.

dns.resolveNs(domainName, {host: '1.1.1.1'})

Takes a string and returns an array of NS Records associated with the supplied domain if any.

dns.resolveTxt(domainName, {host: '1.1.1.1'})

Takes a string and returns an array of TXT Records associated with the supplied domain if any.

License

MIT

Keywords

FAQs

Package last updated on 27 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc