node dns.resolve4解析hostname

node dns解析hostname

dns.resolve4('baidu.com', function (err, addresses) {
    if (err) {
        console.log('ERR',err);
    } else {
        console.log(addresses);
        //[ '123.125.115.110', '220.181.57.216' ]
    }
});

你可能感兴趣的:(node dns.resolve4解析hostname)