Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dnscrypt

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnscrypt

DNSCrypt - authenticated and encrypted DNS client

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

dnscrypt

stability-unstable Build Status npm node license downloads

dnscrypt logo

DNSCrypt - authenticated and encrypted DNS client for nodejs

Usage

const dnscrypt = require('dnscrypt');

dnscrypt.resolve('example.com', (err, addresses) => {
  if (err) {
    console.error(err);
  } else {
    console.log(addresses);
  }
});

// Supports both callback and promise-based styles.
await dnscrypt.resolve4('example.com');

const resolver = dnscrypt.createResolver({ timeout: 1e3 });

How to

  • Use global api dnscrypt.resolve for single looking up.
  • Use resolver api dnscrypt.createResolver() for multiple lookups (to avoid repeated certificate requests).

API

  • dnscrypt.resolve(hostname[, rrtype], callback): void
  • dnscrypt.resolve(hostname[, rrtype]): Promise

See dns.resolve.

  • dnscrypt.resolve4(hostname[, options], callback): void
  • dnscrypt.resolve4(hostname[, options]): Promise

See dns.resolve4.

  • dnscrypt.resolve6(hostname[, options], callback): void
  • dnscrypt.resolve6(hostname[, options]): Promise

See dns.resolve6.

  • dnscrypt.resolveCname(hostname, callback): void
  • dnscrypt.resolveCname(hostname): Promise

See dns.resolveCname.

  • dnscrypt.resolveMx(hostname, callback): void
  • dnscrypt.resolveMx(hostname): Promise

See dns.resolveMx.

  • dnscrypt.resolveNs(hostname, callback): void
  • dnscrypt.resolveNs(hostname): Promise

See dns.resolveNs.

  • dnscrypt.resolvePtr(hostname, callback): void
  • dnscrypt.resolvePtr(hostname): Promise

See dns.resolvePtr.

  • dnscrypt.resolveSoa(hostname, callback): void
  • dnscrypt.resolveSoa(hostname): Promise

See dns.resolveSoa.

  • dnscrypt.resolveSrv(hostname, callback): void
  • dnscrypt.resolveSrv(hostname): Promise

See dns.resolveSrv.

  • dnscrypt.resolveTxt(hostname, callback): void
  • dnscrypt.resolveTxt(hostname): Promise

See dns.resolveTxt.

  • dnscrypt.getServers(): DNSStamp[]

Returns an array of active DNS servers.

  • dnscrypt.createResolver([options]): Resolver

Create a new independent resolver for DNS requests.

  • options.timeout: number - The number of milliseconds before a request times out, 2s default.
  • options.unref: bool - Call .unref() on internal dgram socket.
  • options.sdns: string - Use secure DNS resolver instead of default one.

The following methods from the dnscrypt module are available:

  • resolver.resolve(hostname[, rrtype], callback): void

  • resolver.resolve(hostname[, rrtype]): Promise

  • resolver.resolve4(hostname[, options], callback): void

  • resolver.resolve4(hostname[, options]): Promise

  • resolver.resolve6(hostname[, options], callback): void

  • resolver.resolve6(hostname[, options]): Promise

  • resolver.resolveCname(hostname, callback): void

  • resolver.resolveCname(hostname): Promise

  • resolver.resolveMx(hostname, callback): void

  • resolver.resolveMx(hostname): Promise

  • resolver.resolveNs(hostname, callback): void

  • resolver.resolveNs(hostname): Promise

  • resolver.resolvePtr(hostname, callback): void

  • resolver.resolvePtr(hostname): Promise

  • resolver.resolveSoa(hostname, callback): void

  • resolver.resolveSoa(hostname): Promise

  • resolver.resolveSrv(hostname, callback): void

  • resolver.resolveSrv(hostname): Promise

  • resolver.resolveTxt(hostname, callback): void

  • resolver.resolveTxt(hostname): Promise

  • resolver.getServers(): DNSStamp[]

  • resolver.setServers(sdns): void

Change the address of internal secure DNS server.

  • resolver.close(): void

Close encrypted DNS session.

License

MIT, 2019 (c) Dmitriy Tsvettsikh

Keywords

FAQs

Package last updated on 21 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc