Comparing version 0.1.0 to 0.1.1
@@ -24,2 +24,3 @@ #!/usr/bin/env node | ||
let recursive = false; | ||
let unbound = false; | ||
let hints = null; | ||
@@ -83,2 +84,7 @@ let anchors = null; | ||
break; | ||
case '-u': | ||
case '--unbound': | ||
unbound = true; | ||
recursive = true; | ||
break; | ||
case '--hints': | ||
@@ -208,3 +214,11 @@ hints = Hints.fromFile(process.argv[i + 1]); | ||
async function resolve(name, type, options) { | ||
const dns = recursive ? require('../lib/rdns') : require('../lib/dns'); | ||
let dns; | ||
if (unbound) | ||
dns = require('../lib/udns'); | ||
else if (recursive) | ||
dns = require('../lib/rdns'); | ||
else | ||
dns = require('../lib/dns'); | ||
const resolver = new dns.Resolver(options); | ||
@@ -211,0 +225,0 @@ |
@@ -10,2 +10,3 @@ #!/usr/bin/env node | ||
const RecursiveServer = require('../lib/server/recursive'); | ||
const UnboundServer = require('../lib/server/unbound'); | ||
const StubServer = require('../lib/server/stub'); | ||
@@ -19,2 +20,3 @@ const util = require('../lib/util'); | ||
let recursive = false; | ||
let unbound = false; | ||
let hintsFile = null; | ||
@@ -58,2 +60,7 @@ let origin = '.'; | ||
break; | ||
case '-u': | ||
case '--unbound': | ||
unbound = true; | ||
recursive = true; | ||
break; | ||
case '--hints': | ||
@@ -126,2 +133,4 @@ hintsFile = process.argv[i + 1]; | ||
Server = AuthServer; | ||
else if (unbound) | ||
Server = UnboundServer; | ||
else if (recursive) | ||
@@ -128,0 +137,0 @@ Server = RecursiveServer; |
@@ -39,2 +39,5 @@ /*! | ||
const tsig = require('./tsig'); | ||
// const udns = require('./udns'); | ||
// const UnboundResolver = require('./resolver/unbound'); | ||
// const UnboundServer = require('./server/unbound'); | ||
const util = require('./util'); | ||
@@ -74,4 +77,7 @@ const wire = require('./wire'); | ||
exports.tsig = tsig; | ||
// exports.udns = udns; | ||
// exports.UnboundResolver = UnboundResolver; | ||
// exports.UnboundServer = UnboundServer; | ||
exports.util = util; | ||
exports.wire = wire; | ||
exports.Zone = Zone; |
@@ -288,2 +288,13 @@ /*! | ||
out += this.toHintString(); | ||
if (this.anchors.length > 0) | ||
out += this.toAnchorString(); | ||
return out; | ||
} | ||
toHintString() { | ||
let out = ''; | ||
out += ';\n'; | ||
@@ -301,12 +312,16 @@ out += '; Root Zone\n'; | ||
if (this.anchors.length > 0) { | ||
out += ';\n'; | ||
out += '; Trust Anchors\n'; | ||
out += ';\n'; | ||
out += '\n'; | ||
return out; | ||
} | ||
for (const rr of this.anchors) | ||
out += `${rr.toString()}\n`; | ||
} | ||
toAnchorString() { | ||
let out = ''; | ||
out += ';\n'; | ||
out += '; Trust Anchors\n'; | ||
out += ';\n'; | ||
out += '\n'; | ||
for (const rr of this.anchors) | ||
out += `${rr.toString()}\n`; | ||
return out; | ||
@@ -313,0 +328,0 @@ } |
@@ -13,2 +13,3 @@ /*! | ||
const assert = require('assert'); | ||
const IP = require('binet'); | ||
const Authority = require('../authority'); | ||
@@ -29,2 +30,3 @@ const Cache = require('../cache'); | ||
Question, | ||
Record, | ||
types, | ||
@@ -59,2 +61,4 @@ typeToString, | ||
this.maxReferrals = 30; | ||
this.minimize = false; | ||
this.ub = null; | ||
@@ -90,5 +94,33 @@ this.initOptions(options); | ||
if (options.minimize != null) { | ||
assert(typeof options.minimize === 'boolean'); | ||
this.minimize = options.minimize; | ||
} | ||
return this; | ||
} | ||
setStub(host, port, ds) { | ||
assert(typeof host === 'string'); | ||
assert((port & 0xffff) === port); | ||
assert(port !== 0); | ||
assert(ds instanceof Record); | ||
assert(ds.type === types.DS); | ||
const ip = IP.normalize(host); | ||
this.hints.clear(); | ||
this.hints.ns.push('hints.local.'); | ||
if (IP.isIPv4String(ip)) | ||
this.hints.inet4.set('hints.local.', ip); | ||
else | ||
this.hints.inet6.set('hints.local.', ip); | ||
this.hints.anchors.push(ds.clone()); | ||
this.hints.port = port; | ||
return this; | ||
} | ||
getAuthority() { | ||
@@ -95,0 +127,0 @@ return this.hints.getAuthority(this.inet6); |
{ | ||
"name": "bns", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "DNS bike-shed", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"dependencies": { | ||
"bcrypto": "~0.3.0", | ||
"bcrypto": "~0.3.2", | ||
"bfile": "~0.1.0", | ||
@@ -49,12 +49,17 @@ "bheep": "~0.1.0", | ||
}, | ||
"optionalDependencies": { | ||
"unbound": "~0.0.1" | ||
}, | ||
"devDependencies": { | ||
"babelify": "^8.0.0", | ||
"babel-core": "^6.26.3", | ||
"babel-loader": "^7.1.4", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-polyfill": "^6.26.0", | ||
"babel-preset-env": "^1.7.0", | ||
"babelify": "^8.0.0", | ||
"browserify": "^16.2.2", | ||
"eslint": "^4.19.1", | ||
"mocha": "^5.2.0", | ||
"uglify-es": "^3.3.9", | ||
"uglifyjs-webpack-plugin": "^1.2.5", | ||
"uglify-es": "^3.3.9", | ||
"webpack": "^4.11.1", | ||
@@ -67,3 +72,4 @@ "webpack-cli": "^3.0.3" | ||
"browser": { | ||
"./lib/lazy": "./lib/lazy-browser.js" | ||
"./lib/lazy": "./lib/lazy-browser.js", | ||
"./lib/resolver/unbound": "./lib/resolver/unbound-browser.js" | ||
}, | ||
@@ -70,0 +76,0 @@ "browserify": { |
@@ -18,3 +18,4 @@ 'use strict'; | ||
modules: ['node_modules'], | ||
extensions: ['-browser.js', '.js', '.json'] | ||
extensions: ['-browser.js', '.js', '.json'], | ||
alias: require('bcrypto/compat') | ||
}, | ||
@@ -21,0 +22,0 @@ module: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
588236
68
22966
9
13
+ Addedunbound@0.0.5(transitive)
Updatedbcrypto@~0.3.2