universal-doh
Universal DNS over HTTPS TypeScript/JavaScript library
Try It Now
DNS response will appear here.
Why Use universal-doh?
universal-doh is a TypeScript library for performing DNS over
HTTPS (DoH) queries across various environments. It's designed to be
universal, lightweight, and fully typed.
Features
-
Universal Compatibility:
Works seamlessly in Node.js (v18+), browsers, web workers, Cloudflare
Workers, Bun, and more.
-
Batteries Included:
Built-in support for IDN (International Domain Names) through punycode,
configurable timeouts, and basic caching.
-
No Dependencies:
Zero runtime dependencies and supports tree shaking to minimize bundle
size.
-
Open Source:
Released under the
MIT License, source available on
GitHub.
-
Truly Asynchronous:
Unlike Node's
dns.lookup()
which uses blocking threads,
universal-doh performs DNS queries asynchronously over HTTPS,
ensuring efficient resolution even under high load or with slow system
resolvers.
-
TypeScript Support:
Written entirely in TypeScript with complete type definitions.
Non-Goals
universal-doh is not intended to be a drop-in replacement for
Node's DNS package.