default to SERVFAIL for recurse
This commit is contained in:
parent
0151500ac8
commit
d7e208d3f7
|
@ -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 () {
|
||||
|
|
Loading…
Reference in New Issue