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

evil-dns

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evil-dns - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

tests/clear.tests.js

31

evil-dns.js
var dns = require('dns'),
net = require('net'),
dnsLookup = dns.lookup;
dnsLookup = dns.lookup,
domains = [];

@@ -10,13 +10,12 @@

dns.lookup = function(domain, family, callback) {
dns.lookup = function(domain, options, callback) {
var i;
if (arguments.length === 2) {
callback = family;
family = 0;
callback = options;
options = {};
}
else if (!family) {
family = 0;
}
else {
var family = (typeof(options) === 'object') ? options.family : options;
if (family) {
family = +family;

@@ -36,3 +35,3 @@ if (family !== 4 && family !== 6) {

return dnsLookup.call(this, domain, family, callback);
return dnsLookup.call(this, domain, options, callback);
};

@@ -101,2 +100,9 @@

/**
* Remove all domains from the override list
**/
function clear() {
domains = [];
}
function createRegex(val) {

@@ -114,3 +120,3 @@ var parts = val.split('*'),

return new RegExp(val, 'i');
};
}

@@ -120,3 +126,3 @@

return val.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
}

@@ -126,3 +132,4 @@ module.exports = {

remove: remove,
clear: clear,
domains: domains
};
};
{
"name": "evil-dns",
"version": "0.0.2",
"version": "0.1.0",
"description": "Override the IP address returned for one or more domains.",
"main": "evil-dns.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "mocha -R spec ./tests"
},
"engines": {
"node" : ">=0.12"
},
"repository": {

@@ -22,2 +25,10 @@ "type": "git",

"author": "James Hight",
"contributors": [
{
"name": "Martin Heidegger"
},
{
"name": "Jacob Page"
}
],
"licenses": [

@@ -32,3 +43,7 @@ {

"url": "https://github.com/JamesHight/node-evil-dns/issues"
},
"devDependencies": {
"chai": "^2.1.0",
"mocha": "^2.1.0"
}
}

@@ -34,2 +34,5 @@ Evil DNS

evilDns.remove(/^foo\.bar\..*$/i);
````
// Remove all domain entries
evilDns.clear();
````

Sorry, the diff of this file is not supported yet

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