UNPKG

@leichtgewicht/dns-socket

Version:

Make low-level DNS requests with retry and timeout support.

15 lines (13 loc) 336 B
"use strict"; var _dnsSocket = require("@leichtgewicht/dns-socket"); const socket = new _dnsSocket.DNSSocket(); socket.query({ flags: _dnsSocket.DNSSocket.RECURSION_DESIRED, questions: [{ type: 'ANY', name: 'www.dr.dk' }] }, 53, '8.8.8.8', function (err, response) { console.log(err, response); socket.destroy(); });