From faad982f0f8d2a7c012d9f26998d16b5ceaf8281 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 23 Aug 2022 14:34:44 -0400 Subject: [PATCH] *Properly handle recursive queries to the icann resolver --- src/index.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 5336b72..8b7e7f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -193,22 +193,31 @@ export default class Handshake extends AbstractResolverModule { const hnsNs = await this.resolver.resolve(foundDomain, options); if (hnsNs.records.length) { - return this.resolver.resolve(domain, { + let icannRecords = await this.resolver.resolve(domain, { ...options, options: { subquery: true, nameserver: hnsNs.records.pop()?.value, }, }); + if (icannRecords.records.length) { + records.push.apply(records, icannRecords.records); + } } return resolverEmptyResponse(); } - return this.resolver.resolve(domain, { + let icannRecords = await this.resolver.resolve(domain, { ...options, options: { subquery: true, nameserver: foundDomain }, }); + if (icannRecords.records.length) { + records.push.apply(records, icannRecords.records); + return; + } + + return resolverEmptyResponse(); } let result = await this.resolver.resolve(record.ns, options, bypassCache);