# doh-js-client

> DNS-over-HTTPS/DNS-over-TLS client for nodejs.

Latest version **0.2.1** (published 2023-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install doh-js-client
pnpm add doh-js-client
yarn add doh-js-client
bun add doh-js-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.1 |
| Published | 2023-04-22 |
| First published | 2020-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 24.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Peter Lai |
| Maintainers | sc0vu |
| Keywords | DoH, DNS-over-HTTPS, DoT, DNS-over-TLS |

## Links

- npm: https://www.npmjs.com/package/doh-js-client
- npm.io page: https://npm.io/package/doh-js-client

## Dependencies (2)

- [xhr2](https://npm.io/package/xhr2.md) ^0.2.0
- [native-dns-packet](https://npm.io/package/native-dns-packet.md) ^0.1.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.2.1 (latest) — 2023-04-22
- 0.2.0 — 2020-05-30
- 0.1.3 — 2020-05-24
- 0.1.1 — 2020-05-24
- 0.1.0 — 2020-05-24

## README

# doh-js-client
[![Build Status](https://travis-ci.org/sc0Vu/doh-js-client.svg?branch=master)](https://travis-ci.org/sc0Vu/doh-js-client)

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').DoH

let 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').DoT

let 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

---
_Source: https://npm.io/package/doh-js-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
