How to DNS Lookup in JavaScript - Code Snippet

How to perform 'DNS Lookup' in JavaScript.

example.js
// Task: DNS Lookup
// Language: JavaScript

function dnsLookup() {
    // Implementation for DNS Lookup
    const result = ...; // Initialize variable
    // TODO: Implement core logic here
    // Step 1: Prepare data
    // Step 2: Process DNS Lookup
    console.log("Done");
}
AdSense Slot