node-modules/failover-dns

Name: failover-dns

Owner: node_modules

Description: Use local cache dns query result when dns query fail.

Created: 2016-09-26 11:30:34.0

Updated: 2018-05-05 21:35:03.0

Pushed: 2016-09-27 05:36:39.0

Homepage: null

Size: 10

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

failover-dns

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Use local cache dns query result when dns query fail.

Installation
m install failover-dns
Quick start
t dns = require('failover-dns');

ust listen `error` event to logging by yourself
on('error', err => console.error(err));

lookup('cnpmjs.org', { family: 4, timeout: 2000 }, (err, ip, family) => {
 (err) throw err;
nsole.log(ip, family);

Default dns query timeout

Default is 0:

rts.defaultTimeout = 0;

Maybe you want to set global default timeout is 2000ms:

rts.defaultTimeout = 2000;
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.