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

dohdec

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dohdec

DNS over HTTPS and DNS over TLS

  • 6.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 09 Sep 2024

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