Skip to content

Cacheable lookup responds with ESERVFAIL while native dns.resolve works #68

@lokesh411

Description

@lokesh411

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions