log.info(`----- ${action}: ${target}, use alive ip from dns '${aliveIpObj.dns}': ${aliveIpObj.host} -----`)
log.info(`----- ${action}: ${hostname}, use alive ip from dns '${aliveIpObj.dns}': ${aliveIpObj.host}${target} -----`)
callback(null,aliveIpObj.host,4)
return
}else{
log.info(`----- ${action}: ${target}, no alive ip, tester:`,tester)
log.info(`----- ${action}: ${hostname}, no alive ip${target}, tester:`,tester)
}
}
dns.lookup(hostname).then(ip=>{
@ -38,16 +40,16 @@ module.exports = {
}
}
if(isTestFailedIp===false){
log.info(`----- ${action}: ${target}, use ip from dns '${dns.name}': ${ip} -----`)
log.info(`----- ${action}: ${hostname}, use ip from dns '${dns.name}': ${ip}${target} -----`)
callback(null,ip,4)
return
}else{
// 使用默认dns
log.info(`----- ${action}: ${target}, use hostname by default DNS: ${hostname}, skip test failed ip from dns '${dns.name}: ${ip}', options:`,options)
log.info(`----- ${action}: ${hostname}, use hostname by default DNS: ${hostname}, skip test failed ip from dns '${dns.name}: ${ip}'${target}, options:`,options)
}
}else{
// 使用默认dns
log.info(`----- ${action}: ${target}, use hostname by default DNS: ${hostname}, options:`,options,', dns:',dns)
log.info(`----- ${action}: ${hostname}, use hostname by default DNS: ${hostname}${target}, options:`,options,', dns:',dns)