dohdec
TypeScript icon, indicating that this package has built-in type declarations

6.0.4 • Public • Published

dohdec

Retrieve and decode DNS records using DNS-over-HTTPS (DoH) or DNS-over-TLS (DoT).

Install

npm install --save dohdec

Command Line Usage

You must now install dohdec-cli to use the command line:

npm install -g dohdec-cli

API Usage

const {DNSoverHTTPS, DNSoverTLS} = require('dohdec');

const doh = new DNSoverHTTPS();
await doh.lookup('ietf.org', 'AAAA'); // JSON result from CloudFlare
await doh.lookup('ietf.org', {
  rrtype: 'MX',
  json: false, // Use DNS wire format
  decode: false, // Do not decode results
  dnssec: true, // Request DNS records
});
const dot = new DNSoverTLS({host: '1.1.1.1'});
await dot.lookup('ietf.org');

Full documents here

More Features

If you need a more full-featured replacement for [dnsPromises.Resolver]https://nodejs.org/api/dns.html#class-dnspromisesresolver), take a look at the Tangerine project.

Notes

  • All queries will be padded to the next multiple of 128 bytes (see RFC 8467)
  • The JSON protocols are not standardized. The best we have is Google's documentation, which Cloudlflare seems to have followed.

License

MPL-2.0

Tests codecov

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.0.4
6latest

Version History

VersionDownloads (Last 7 Days)Published
6.0.4
6
6.0.3
2
6.0.1
0
6.0.0
1
5.0.3263
5.0.10
5.0.01
4.0.00
3.1.0127
3.0.01
2.1.00
2.0.00
1.1.00
1.0.00

Package Sidebar

Install

npm i dohdec

Weekly Downloads

62

Version

6.0.4

License

MIT

Unpacked Size

50.4 kB

Total Files

13

Last publish

Collaborators

  • hildjj