dns-info

說明

dns是網際網路中重要的一項服務,透過dns可以查詢到對應的IP位置,透過dns的A record可以對網頁伺服器有最基本的round robin的輪詢效果,

Installation

npm install dns-info

範例程式

var dnsInfo = require('dns-info');

dnsInfo({
      domain: 'www.google.com',
      server: {
            address: '168.95.1.1',
        port: 53,
        type: 'udp'
      },
      timeout: 5000
}).then(function(info) {
      console.log(info)
}).catch(function(e) {
      console.error(e)
})

執行結果:

{ domain: 'www.google.com',
  byTypes:
   [ { type: 'A', data: [Object] },
     { type: 'AAAA', data: [Object] } ],
  byAny:
   [ { type: 'A', ttl: 299, address: '74.125.203.99' },
     { type: 'A', ttl: 299, address: '74.125.203.103' },
     { type: 'A', ttl: 299, address: '74.125.203.105' },
     { type: 'A', ttl: 299, address: '74.125.203.106' },
     { type: 'A', ttl: 299, address: '74.125.203.104' },
     { type: 'A', ttl: 299, address: '74.125.203.147' },
     { type: 'AAAA',
       ttl: 299,
       address: '2404:6800:4008:c03:0:0:0:69' } ] }

results matching ""

    No results matching ""