Friday, 11 April 2025

Filled under:

  for (const ip of ipList) {

      Amelia.host.runCommand(`nslookup ${ip}`, function(result) {

        if (result.code !== 0 || !result.stdout) {

          hostnameMap[ip] = "⚠️ nslookup failed";

        } else {

          const match = result.stdout.match(/name\s*=\s*(\S+)/i);

          hostnameMap[ip] = match ? match[1] : "⚠️ Hostname not found";

        }

0 comments:

Post a Comment