diff --git a/README.md b/README.md index fa526c8..d41c2e3 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Request creation takes an object with the following fields * `type` -- a string indicating `udp` or `tcp` (optional, default `udp`) You do not need to indicate ipv4 or ipv6, the backend will handle that - a string ip address + * `additional` -- an array of Additional Resource Records (optional) * `timeout` -- a number in milliseconds indicating how long to wait for the request to finish. (optional, default 4000) * `try_edns` -- a boolean indicating whether to use an `EDNSPacket` (optional) diff --git a/lib/client.js b/lib/client.js index ffa66d7..f1f4b64 100644 --- a/lib/client.js +++ b/lib/client.js @@ -52,6 +52,7 @@ var Request = exports.Request = function(opts) { if (!(this instanceof Request)) return new Request(opts); this.question = opts.question; + this.additional = opts.additional || []; this.server = opts.server; if (typeof(this.server) === 'string' || this.server instanceof String) diff --git a/lib/pending.js b/lib/pending.js index e6c0c06..a6a214f 100644 --- a/lib/pending.js +++ b/lib/pending.js @@ -126,6 +126,7 @@ SocketQueue.prototype._dequeue = function() { } packet.question.push(req.question); + packet.additional.push.apply(packet.additional, req.additional); packet.send(); this._ref();