Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Fix dns.resolve() with 'PTR' throws Error: Unknown type "PTR" #1038

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/dns.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ var resolveMap = { A: exports.resolve4,
MX: exports.resolveMx,
TXT: exports.resolveTxt,
SRV: exports.resolveSrv,
PTR: exports.resolvePtr,
PTR: exports.reverse,
NS: exports.resolveNs,
CNAME: exports.resolveCname };

Expand Down
6 changes: 6 additions & 0 deletions test/simple/test-c-ares.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ dns.lookup('ipv6.google.com', function(error, result, addressType) {
//assert.equal('string', typeof result);
assert.equal(6, addressType);
});

dns.resolve('127.0.0.1', 'PTR', function(error, domains) {
if (error) throw error;
assert.ok(Array.isArray(domains));
});