npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dns_lookup_plugin

v1.0.3

Published

Node.js Plugin to Lookup DNS Records.

Downloads

6

Readme

DNS Lookup Plugin

This will allow you to do a DNS lookup for any Domain, and will provide you with a JSON output.

  • Requires: awk jq & dig installed.
  • Only works on Linux
  • Example Project Using this Plugin @ https://github.com/Bioblaze/dns_lookup_service Example Output
user@DESKTOP:/mnt/e/Github/dns_lookup_plugin$ node test.js 
[ { Name: 'divine.games.',
    TTL: '0',
    Class: 'IN',
    Type: 'TXT',
    IpAddress: '"heritage=external-dns,external-dns/owner=test,external-dns/resource=service/default/nginx"' } ]

Example Usage

var dns = require('dns_lookup_plugin');


var domain = "divine.games";
var type = "txt";

dns.lookup(domain,type).then((data) => {
    console.log(data);
}).catch((err) => {
    console.error(err);
})

Install Required Applications

  • jq: sudo apt-get install jq
  • awk: sudo apt-get install gawk
  • dig: sudo apt-get install dig

Notes

  • Todo: Make it work on Windows

Regex used for Domain Validation

  • Regex: /(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/

Supported DNS Record Types:

// #INFO List of DNS Record Types
// #URL https://en.wikipedia.org/wiki/List_of_DNS_record_types

const record_types = [
    //Resource Records
    'a',
    'aaaa',
    'afsdb',
    'apl',
    'caa',
    'cdnskey',
    'cds',
    'cert',
    'cname',
    'csync',
    'dhcid',
    'dlv',
    'dname',
    'dnskey',
    'ds',
    'eui48',
    'eui64',
    'hinfo',
    'hip',
    'ipseckey',
    'key',
    'kx',
    'loc',
    'mx',
    'naptr',
    'ns',
    'nsec',
    'nsec3',
    'nsec3param',
    'openpgpkey',
    'ptr',
    'rrsig',
    'rp',
    'sig',
    'smimea',
    'soa',
    'srv',
    'sshfp',
    'ta',
    'tkey',
    'tlsa',
    'tsig',
    'txt',
    'uri',
    'zonemd',
    'svcb',

    //Pseudo-RRs Record Types
    '*',
    'axfr',
    'ixfr',
    'opt',

    //Obsolete Record Types
    'md',
    'mf',
    'maila',
    'mb',
    'mg',
    'mr',
    'minfo',
    'mailb',
    'wks',
    'nb',
    'nbstat',
    'null',
    'a6',
    'nxt',
    'key',
    'sig',
    'hinfo',
    'rp',
    'x25',
    'isdn',
    'rt',
    'nsap',
    'nsap-ptr',
    'px',
    'eid',
    'nimloc',
    'atma',
    'apl',
    'sink',
    'gpos',
    'uinfo',
    'uid',
    'gid',
    'unspec',
    'spf',
    'ninfo',
    'rkey',
    'talink',
    'nid',
    'l32',
    'l64',
    'lp',
    'doa'
];