*Properly handle recursive queries to the icann resolver

This commit is contained in:
Derrick Hammer 2022-08-23 14:34:44 -04:00
parent f86a05f2be
commit faad982f0f
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 11 additions and 2 deletions

View File

@ -193,22 +193,31 @@ export default class Handshake extends AbstractResolverModule {
const hnsNs = await this.resolver.resolve(foundDomain, options); const hnsNs = await this.resolver.resolve(foundDomain, options);
if (hnsNs.records.length) { if (hnsNs.records.length) {
return this.resolver.resolve(domain, { let icannRecords = await this.resolver.resolve(domain, {
...options, ...options,
options: { options: {
subquery: true, subquery: true,
nameserver: hnsNs.records.pop()?.value, nameserver: hnsNs.records.pop()?.value,
}, },
}); });
if (icannRecords.records.length) {
records.push.apply(records, icannRecords.records);
}
} }
return resolverEmptyResponse(); return resolverEmptyResponse();
} }
return this.resolver.resolve(domain, { let icannRecords = await this.resolver.resolve(domain, {
...options, ...options,
options: { subquery: true, nameserver: foundDomain }, 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); let result = await this.resolver.resolve(record.ns, options, bypassCache);