@amoo-miki/dns-sync

0.2.2 • Public • Published

node-dns-sync

Sync/Blocking DNS resolve. Main usecase is in node server startup.

How to Use

If coming from dns-sync, replace the entry in the package dependencies:

  "dependencies": {
    "dns-sync": "npm:@amoo-miki/dns-sync@~0.2",
    ...
  }
var dnsSync = require('dns-sync');

console.log(dnsSync.resolve('www.paypal.com'));     //should return the IP address
console.log(dnsSync.resolve('www.yahoo.com'));
console.log(dnsSync.resolve('www.non-host.something')); //should return null

console.log(dnsSync.resolve('www.google.com', 'AAAA')); //should return AAAA records
console.log(dnsSync.resolve('google.com', 'NS'));   //should return NS record

Package Sidebar

Install

npm i @amoo-miki/dns-sync

Weekly Downloads

26,271

Version

0.2.2

License

MIT

Unpacked Size

14.7 kB

Total Files

19

Last publish

Collaborators

  • amoo_miki