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

@dnspect/dns-ts

v0.2.2

Published

DNS library in TypeScript

Downloads

9

Readme

@dnspect/dns-ts

npm   Run npm tests   Lint  

DNS library in TypeScript.

Features

  • DNSSEC
  • EDNS(0)
  • Message compression

Install

Add this package to your package.json by running this in the root of your project's directory:

npm install @dnspect/dns-ts

Usage

This package is designed to have no dependency on specific JavaScript runtime.

Build a DNS message:

import { MessageBuilder, RRType } from "@dnspect/dns-ts";

const mb = new MessageBuilder();
const hb = mb.header();
hb.randomId();

const qb = mb.question();
qb.push_in("example.com", RRType.A);

const msg = mb.build();

Parse wireformat data:

import { Message, stringToBinary } from "@dnspect/dns-ts";

// ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2
// ;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
//
// ;; QUESTION SECTION:
// ;example.com.  IN A
const msg = Message.unpack(
  stringToBinary("000201000001000000000000076578616d706c6503636f6d0000010001", "hex")
);

Supported RFCs

This is a list adopted from https://github.com/miekg/dns/blob/master/README.md. This library may not be going to support all of them, but should mark the RFCs that it supports.

  • [x] 103{4,5} - DNS standard
  • [ ] 1348 - NSAP record (removed the record)
  • [ ] 1982 - Serial Arithmetic
  • [x] 1876 - LOC record
  • [ ] 1995 - IXFR
  • [ ] 1996 - DNS notify
  • [ ] 2136 - DNS Update (dynamic updates)
  • [ ] 2537 - RSAMD5 DNS keys
  • [x] 2065 - DNSSEC (updated in later RFCs)
  • [x] 2671 - EDNS record
  • [x] 2782 - SRV record
  • [x] 2845 - TSIG record
  • [ ] 2915 - NAPTR record
  • [ ] 2929 - DNS IANA Considerations
  • [ ] 3110 - RSASHA1 DNS keys
  • [ ] 3123 - APL record
  • [x] 3225 - DO bit (DNSSEC OK)
  • [ ] 340{1,2,3} - NAPTR record
  • [ ] 3445 - Limiting the scope of (DNS)KEY
  • [ ] 3597 - Unknown RRs
  • [ ] 4025 - A Method for Storing IPsec Keying Material in DNS
  • [ ] 403{3,4,5} - DNSSEC + validation functions
  • [x] 4255 - SSHFP record
  • [x] 4343 - Case insensitivity
  • [x] 4408 - SPF record
  • [ ] 4509 - SHA256 Hash in DS
  • [x] 4592 - Wildcards in the DNS
  • [ ] 4635 - HMAC SHA TSIG
  • [ ] 4701 - DHCID
  • [x] 4892 - id.server
  • [x] 5001 - NSID
  • [x] 5155 - NSEC3 record
  • [ ] 5205 - HIP record
  • [ ] 5702 - SHA2 in the DNS
  • [ ] 5936 - AXFR
  • [ ] 5966 - TCP implementation recommendations
  • [ ] 6605 - ECDSA
  • [ ] 6725 - IANA Registry Update
  • [ ] 6742 - ILNP DNS
  • [ ] 6840 - Clarifications and Implementation Notes for DNS Security
  • [ ] 6844 - CAA record
  • [x] 6891 - EDNS0 update
  • [ ] 6895 - DNS IANA considerations
  • [ ] 6944 - DNSSEC DNSKEY Algorithm Status
  • [ ] 6975 - Algorithm Understanding in DNSSEC
  • [ ] 7043 - EUI48/EUI64 records
  • [ ] 7314 - DNS (EDNS) EXPIRE Option
  • [ ] 7477 - CSYNC RR
  • [ ] 7828 - edns-tcp-keepalive EDNS0 Option
  • [ ] 7553 - URI record
  • [ ] 7858 - DNS over TLS: Initiation and Performance Considerations
  • [x] 7871 - EDNS0 Client Subnet
  • [x] 7873 - Domain Name System (DNS) Cookies
  • [ ] 8080 - EdDSA for DNSSEC
  • [ ] 8499 - DNS Terminology
  • [ ] 8659 - DNS Certification Authority Authorization (CAA) Resource Record
  • [ ] 8777 - DNS Reverse IP Automatic Multicast Tunneling (AMT) Discovery
  • [x] 8914 - Extended DNS Errors
  • [ ] 8976 - Message Digest for DNS Zones (ZONEMD RR)