Kill lui lei Dog---node. js---14 DNS

Source: Internet
Author: User
Tags domain name lookup server port to domain

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.