Skip to content

verbatim flag for dns resolution does not change order #17802

@asbachb

Description

@asbachb

I currently have some issues with dual stack ipv6 resolution. The nodejs dns module returns ipv4 address instead of expected ipv6.

I saw there was a PR which introduced a verbatim flag: #14731

Based on the test (https://github.com/nodejs/node/pull/14731/files#diff-91621d3f4af56103203147a5cc370565) I tried to do some test code to validate if it's doing what I expect: Order the ipv6 before the ipv4 which was not the case:

const domain = 'google.com'

const cares = process.binding('cares_wrap');
const req1 = new cares.GetAddrInfoReqWrap();

dns(false);
dns(true);

function dns(verbatim) {
  const req = new cares.GetAddrInfoReqWrap();
  cares.getaddrinfo(req, domain, 0, /* hints */ 0, /* verbatim */ verbatim);

  req.oncomplete = function(err, domains) {
    console.log('%s = ', domain, domains);
  };
}

output:

google.com =  [ '172.217.23.142', '2a00:1450:4001:81e::200e' ]
google.com =  [ '172.217.23.142', '2a00:1450:4001:81e::200e' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    dnsIssues and PRs related to the dns subsystem.questionIssues that look for answers.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions