1.0.0 • Published 10 months ago
@gucheen/doh-js-client v1.0.0
doh-js-client
DNS-over-HTTPS/DNS-over-TLS client for nodejs, secure your nodejs dns query with modern tls.
changes of this fork
- migrate to ES modules
- add ali and dnspod as DNS provider
- add typescript declaration file
Install
$ npm install @gucheen/doh-js-clientUsage
DNS over HTTPS (:443)
- 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
})DNS over TLS (:583)
- 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
})Known issue and supported dns type
Cleanbrowsing doesn't support caa query (return 400).
Supported dns type:
- A
- AAAA
- CAA
- CNAME
- DS
- DNSKEY
- MX
- NS
- NSEC
- NSEC3
- RRSIG
- SOA
- TXT
License
MIT
1.0.0
10 months ago