Closed
Description
- Version: v8.9.3
- Platform: 4.14.5-1-ARCH deps: update openssl to 1.0.1j #1 SMP PREEMPT Sun Dec 10 14:50:30 UTC 2017 x86_64 GNU/Linux
- Subsystem: dns
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' ]