Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

domain-info

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

domain-info

Simple domain information tool

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
152
Maintainers
1
Weekly downloads
 
Created
Source

domain-info

Build Status

Simple domain infomation client.

install

npm install domain-info

Usage

const domain = require('domain-info');
const callback = (error, data) => {
    console.log(data);
}

domain.groper('github.com', { type: ['A'] }, callback);
// data = { A:
//    [ { name: 'github.com',
//        type: 1,
//        class: 1,
//        ttl: 20,
//        address: '192.30.252.130' } ]
// }

This module return Promise object without callback function.

const domain = require('domain-info');

let promise = domain.groper('github.com', { type: ['A'] });
promise.then(data => {
// data = { A:
//    [ { name: 'github.com',
//        type: 1,
//        class: 1,
//        ttl: 20,
//        address: '192.30.252.130' } ]
// }
});

API

groper(domain, [type, option, callback])

Dig command. Option is node-dns Request method option. type is resource record type like A, MX.

const domain = require('domain-info');
domain.groper(
    'example.com',
    ['A', 'NS', 'MX'],
    {
        server: { address: '8.8.8.8', port: 53, type: 'udp' },
        timeout: 1000
    },
    callback
);

reverse(ip_address, [callback])

Reverse DNS lookup.

const domain = require('domain-info');
domain.reverse('8.8.8.8', (error, data) => {
    // data => [ 'google-public-dns-a.google.com' ]
});

whois(domain, [option, callback])

Whois command. Option has server, port, recordType properties. server has default value TLD.whois-servers.net. port has default value 43 recordType has default value domain

const options = {
    server: 'com.whois-servers.net',
    port: 43,
    recordType: 'domain'
}
const domain = require('domain-info');
domain.whois('example.com', (error, data) => {
    // data has whois results.
});

punycode(ascii_or_unicode)

Convert ascii domain to uicode. Also convert unicode domain to ascii in reverse.

const domain = require('domain-info');

domain.punycode('日本語.jp');
// => xn--wgv71a119e.jp

domain.punycode('xn--wgv71a119e.jp');
// => 日本語.jp

whois(domain, [options, callback])

Whois

const domain = require('domain-info');
domain.whois('a.ns.apple.com', (error, data) => {
    console.log(data);
});

domain-info-cli

License

MIT © kazu69

Keywords

FAQs

Package last updated on 14 Sep 2018

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