# os-dns-native

> Perform DNS queries using OS APIs

Latest version **2.1.3** (published 2026-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install os-dns-native
pnpm add os-dns-native
yarn add os-dns-native
bun add os-dns-native
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.1.3 |
| Published | 2026-09-30 |
| First published | 2021-05-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 23.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 0 |
| Author | Anna Henningsen |
| Maintainers | satyasinha, kristina.stefano, jarjee, devtoolsbot, mongo-j, nbbeeken, dbx-node, devtools-npm-user |

## Links

- npm: https://www.npmjs.com/package/os-dns-native
- Repository: https://github.com/mongodb-js/os-dns-native
- Issues: https://github.com/mongodb-js/os-dns-native/issues
- npm.io page: https://npm.io/package/os-dns-native

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^4.4.3
- [ipv6-normalize](https://npm.io/package/ipv6-normalize.md) ^1.0.1
- [node-addon-api](https://npm.io/package/node-addon-api.md) ^8.9.2

## Recent versions

- 2.1.3 (latest) — 2026-09-30
- 2.1.2 — 2026-09-28
- 2.0.1 — 2026-01-14
- 2.0.0 — 2026-01-12
- 1.2.1 — 2024-01-04
- 1.2.0 — 2022-02-18
- 1.1.2 — 2022-01-27
- 1.1.1 — 2022-01-17
- 1.1.0 — 2022-01-17
- 1.0.4 — 2021-07-16
- 1.0.3 — 2021-05-11
- 1.0.2 — 2021-05-11
- 1.0.1 — 2021-05-11
- 1.0.0 — 2021-05-11

## README

# os-dns-native

Perform DNS queries using native OS APIs. Unlike the built-in `dns.resolve*`
family of functions, this module talks to the OS instead of performing UDP
queries.

Currently, A (IPv4), AAAA (IPv6), CNAME, TXT and SRV are supported.

The library exports match a subset of the Node.js `dns` module's. There is an
extra `.withNodeFallback` variant that allows using the OS methods with a
fallback to the Node.js methods if the former failed.

```js
import osDns from 'os-dns-native';
const addresses = await osDns.promises.resolve6('example.org');
console.log(addresses); // [ '2606:2800:220:1:248:1893:25c8:1946' ]

// Tries the OS API first, falls back to Node.js's own dns.promises.resolve6.
await osDns.withNodeFallback.promises.resolve6('example.org');
```

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