UNPKG

@leichtgewicht/dns-socket

Version:

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

15 lines (12 loc) 296 B
import { DNSSocket } from '@leichtgewicht/dns-socket' const socket = new DNSSocket() socket.query({ flags: DNSSocket.RECURSION_DESIRED, questions: [{ type: 'ANY', name: 'www.dr.dk' }] }, 53, '8.8.8.8', function (err, response) { console.log(err, response) socket.destroy() })