os-dns-native
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

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.

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');

Readme

Keywords

none

Package Sidebar

Install

npm i os-dns-native

Weekly Downloads

30,053

Version

1.2.1

License

MIT

Unpacked Size

22 kB

Total Files

8

Last publish

Collaborators

  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • chuck.kalmanek
  • mongodb-js-user
  • rueckstiess
  • durran
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • stennie
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish