doh-js-client

0.2.1 • Public • Published

doh-js-client

Build Status

DNS-over-HTTPS/DNS-over-TLS client for nodejs, secure your nodejs dns query with modern tls.

Install

$ npm install doh-js-client

Usage

DNS over HTTPS (:443)

  1. Initialize the instance with given provider (google, cloudflare, cleanbrowsing)
const DoH = require('doh-js-client').DoH

let dns = new DoH('google')
  1. Resolve dns name
dns.resolve('example.com', 'A')
  .then(function (record) {
    // do something
  })
  .catch(function (err) {
    // something wrong happened
  })

DNS over TLS (:583)

  1. Initialize the instance with given provider (google, cloudflare, cleanbrowsing)
const DoT = require('doh-js-client').DoT

let dns = new DoT('google', privateKeyFilePath, certificateFilePath)
  1. Resolve dns name
dns.resolve('example.com', 'A')
  .then(function (record) {
    // do something
  })
  .catch(function (err) {
    // something wrong happened
  })

Known issue and supported dns type

  1. Cleanbrowsing doesn't support caa query (return 400).

  2. Supported dns type:

  • A
  • AAAA
  • CAA
  • CNAME
  • DS
  • DNSKEY
  • MX
  • NS
  • NSEC
  • NSEC3
  • RRSIG
  • SOA
  • TXT

License

MIT

Package Sidebar

Install

npm i doh-js-client

Weekly Downloads

3

Version

0.2.1

License

MIT

Unpacked Size

25.2 kB

Total Files

19

Last publish

Collaborators

  • sc0vu