-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hello,
I have come across a issue where cacheable.lookup or cacheable.lookupAsync was giving ESERVFAIL while dns.resolve or dns.lookup worked perfectly fine.
When i went through the code, i found out that we are trying to resolve for both IPv4 and IPv6 addresses for the domain. If the server sends failure (ESERVFAIL) for the dns lookup since the hostname doesn't exists in the respective IP family, even if it can resolve for the other IP family the library throws the error.
Reference:
[https://github.com/szmarczak/cacheable-lookup/blob/master/source/index.js#L244]
Any reasons where we should lookup for both IPv4 and IPv6 addresses?
const [A, AAAA] = await Promise.all([ ignoreNoResultErrors(this._resolve4(hostname, ttl)), ignoreNoResultErrors(this._resolve6(hostname, ttl)) ]);
For a domain i found that resolve4 was working fine but resolve6 was failing with ESERVFAIL error