zhoushaw / zhoushaw.github.io

Github Pages https://zhoushaw.github.io
1 stars 0 forks source link

node查询ip | zhou shaw #8

Open zhoushaw opened 5 years ago

zhoushaw commented 5 years ago

https://zhoushaw.github.io/2018/10/28/learning/nodejs/dns-search/

查询ip 比如我们要查询域名 www.qq.com 对应的ip,可以通过 dns.lookup() 123456var dns = require('dns');dns.lookup('www.qq.com', function(err, address, family){ if(err) throw err; console.lo