Skip to content

Commit

Permalink
Add timeout to DNS Resolver (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
lnedry authored Jan 28, 2024
1 parent 7722666 commit c12337b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
'use strict';

// node.js built-ins
const dns = require('dns').promises;
const net = require('net');
const os = require('os');
const punycode = require('punycode/')
const {Resolver} = require('dns').promises;
const dns = new Resolver({timeout: 25000, tries: 1});
const net = require('net');
const os = require('os');
const punycode = require('punycode/')

// npm modules
const ipaddr = require('ipaddr.js');
const sprintf = require('sprintf-js').sprintf;
const tlds = require('haraka-tld');
const ipaddr = require('ipaddr.js');
const sprintf = require('sprintf-js').sprintf;
const tlds = require('haraka-tld');

const locallyBoundIPs = [];

Expand Down

0 comments on commit c12337b

Please sign in to comment.