Sample code for 30+ languages & platforms
Node.js

DNS Lookup

Do a DNS lookup to resolve a hostname to an IP address.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    //  This example requires the Chilkat API to have been previously unlocked.
    //  See Global Unlock Sample for sample code.

    var socket = new chilkat.Socket();

    var maxWaitMs = 10000;
    var ipAddr = socket.DnsLookup("www.chilkatsoft.com",maxWaitMs);
    if (socket.LastMethodSuccess !== true) {
        console.log(socket.LastErrorText);
        return;
    }

    console.log("IP Address: " + ipAddr);

}

chilkatExample();