default to SERVFAIL for recurse

This commit is contained in:
AJ ONeal 2017-10-06 17:38:55 -06:00
parent 0151500ac8
commit d7e208d3f7
1 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ var common = require('dig.js/common');
var defaultNameservers = require('dns').getServers();
var hexdump;
var NOERROR = 0;
var SERVFAIL = 2;
//var NXDOMAIN = 3;
var REFUSED = 5;
@ -260,7 +261,7 @@ cli.main(function (args, cli) {
, tc: 0 // NA
, rd: 1
, ra: 0 // NA
, rcode: 0 // NA
, rcode: SERVFAIL // NA
}
, question: []
, answer: []
@ -302,6 +303,7 @@ cli.main(function (args, cli) {
, onMessage: function (packet) {
// yay! recursion was available after all!
newResponse.header.ra = 1;
newResponse.header.rcode = NOERROR;
(packet.answer||[]).forEach(function (a) {
// TODO copy each relevant property
@ -336,7 +338,6 @@ cli.main(function (args, cli) {
console.log(";; [" + q.name + "] connection timed out; no servers could be reached");
console.log(";; [timed out after " + res.timeout + "ms and 1 tries]");
count = 1;
updateCount();
}
, onClose: function () {