Node under If you want to domain name resolution is required by Apache or NG reverse version can be achieved, but he also left us a yo set of DNS operation method:
/** * Created by Leigood on 2016/8/30.*///1 Resolve ()--Determine domain name conversion to IP (DNS record)//2 Reverse ()--Reverse IP conversion to Domain name lookup ()varDNS = require (' DNS ');//This can actually be understood as the domain name to see the domain binding on that host//this A is the way the domain name is bound/*dns.resolve (' www.showtp.com ', ' A ', function (err,res) {if (err) {throw err; } console.log (res);});*///Lookup This is also the most recent server port from me, usually do the parsing is to use this/*dns.lookup (' www.showtp.com ', ' 4 ', function (err,res) {if (err) {throw err; } console.log (res);});*///this is through the IP search domain name, but I feel is not very accurateDns.reverse (' 167.114.135.65 ',function(res) {if(res) {Console.log (res); }});
Kill lui lei Dog---node. js---14 DNS