https://github.com/sc0vu/doh-js-client
DNS-over-HTTPS client for nodejs.
https://github.com/sc0vu/doh-js-client
dns-over-https dns-over-tls doh dot
Last synced: 6 months ago
JSON representation
DNS-over-HTTPS client for nodejs.
- Host: GitHub
- URL: https://github.com/sc0vu/doh-js-client
- Owner: sc0Vu
- License: mit
- Created: 2019-07-23T14:01:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T22:18:54.000Z (about 2 years ago)
- Last Synced: 2025-03-27T07:35:57.141Z (6 months ago)
- Topics: dns-over-https, dns-over-tls, doh, dot
- Language: TypeScript
- Size: 612 KB
- Stars: 16
- Watchers: 1
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# doh-js-client
[](https://github.com/sc0Vu/doh-js-client/actions/workflows/ci.yml)DNS-over-HTTPS/DNS-over-TLS client for nodejs, secure your nodejs dns query with modern tls.
# Install
```BASH
$ npm install doh-js-client
```# Usage
## DNS over HTTPS (:443)
1. Initialize the instance with given provider (google, cloudflare, cleanbrowsing)
```JS
const DoH = require('doh-js-client').DoHlet dns = new DoH('google')
```2. Resolve dns name
```JS
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)
```JS
const DoT = require('doh-js-client').DoTlet dns = new DoT('google', privateKeyFilePath, certificateFilePath)
```2. Resolve dns name
```JS
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