DNS-over-HTTPS/DNS-over-TLS client for nodejs, secure your nodejs dns query with modern tls.
$ npm install doh-js-client
- Initialize the instance with given provider (google, cloudflare, cleanbrowsing)
const DoH = require('doh-js-client').DoH
let dns = new DoH('google')
- Resolve dns name
dns.resolve('example.com', 'A')
.then(function (record) {
// do something
})
.catch(function (err) {
// something wrong happened
})
- Initialize the instance with given provider (google, cloudflare, cleanbrowsing)
const DoT = require('doh-js-client').DoT
let dns = new DoT('google', privateKeyFilePath, certificateFilePath)
- Resolve dns name
dns.resolve('example.com', 'A')
.then(function (record) {
// do something
})
.catch(function (err) {
// something wrong happened
})
-
Cleanbrowsing doesn't support caa query (return 400).
-
Supported dns type:
- A
- AAAA
- CAA
- CNAME
- DS
- DNSKEY
- MX
- NS
- NSEC
- NSEC3
- RRSIG
- SOA
- TXT
MIT