Certain version does throw error:
TypeError: Cannot convert name to ASCII
at Resolver.queryA [as resolve4] (dns.js:227:48)
with MacOS BigSur Darwin Kernel Version 20.5.0, node v14.15.4 but does work with node v10.15.3 (ubuntu) and v10.24.1 (ubuntu).
Code which does this unexpected behaviour:
var { Resolver } = require('dns');
var resolver = new Resolver()
resolver.setServers(['8.8.8.8'])
function nslookup(host) {
return new Promise(async function (resolve,reject) {
console.log(`nslookup(${host})`)
resolver.resolve4(host,function(err,ips) {
if (err) {
console.log(err)
return resolve(false)
}
console.log(ips)
return resolve(true)
})
})
}
async function start() {
await nslookup('a.xn--ngbq.com') // success
await nslookup('ab.xn--ngbq.com') // success
await nslookup('a0.xn--ngbq.com') // success
await nslookup('1.xn--ngbq.com') // fails
await nslookup('10000.xn--ngbq.com') // fails
}
start()
for some reason, a valid IDN domain like xn--nqbg.com does with alphanumeric hosts but does not work with number subdomains at my bigsur mac with node v14.15.4, upgraded to v14.17.1 and it still fails
Certain version does throw error:
with MacOS BigSur Darwin Kernel Version 20.5.0, node v14.15.4 but does work with node v10.15.3 (ubuntu) and v10.24.1 (ubuntu).
Code which does this unexpected behaviour:
for some reason, a valid IDN domain like xn--nqbg.com does with alphanumeric hosts but does not work with number subdomains at my bigsur mac with node v14.15.4, upgraded to v14.17.1 and it still fails