Make it functional
Browse files- index.html +18 -2
index.html
CHANGED
|
@@ -413,7 +413,6 @@
|
|
| 413 |
addOutput(`[!] Error: Failed to fetch IP information`);
|
| 414 |
}
|
| 415 |
}
|
| 416 |
-
|
| 417 |
async function lookupDomain(domain) {
|
| 418 |
if (!domain) {
|
| 419 |
addOutput('Error: Domain name required');
|
|
@@ -423,6 +422,23 @@
|
|
| 423 |
addOutput(`[+] Querying Domain: ${domain}`);
|
| 424 |
addOutput('[*] Performing DNS lookup...');
|
| 425 |
|
| 426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
</body>
|
| 428 |
</html>
|
|
|
|
| 413 |
addOutput(`[!] Error: Failed to fetch IP information`);
|
| 414 |
}
|
| 415 |
}
|
|
|
|
| 416 |
async function lookupDomain(domain) {
|
| 417 |
if (!domain) {
|
| 418 |
addOutput('Error: Domain name required');
|
|
|
|
| 422 |
addOutput(`[+] Querying Domain: ${domain}`);
|
| 423 |
addOutput('[*] Performing DNS lookup...');
|
| 424 |
|
| 425 |
+
try {
|
| 426 |
+
// Get WHOIS information
|
| 427 |
+
const response = await fetch(`https://api.whoapi.com/?domain=${domain}&apikey=demo&r=whois`);
|
| 428 |
+
const data = await response.json();
|
| 429 |
+
|
| 430 |
+
if (data.status === 0) {
|
| 431 |
+
addOutput(`[✓] Domain Information:`);
|
| 432 |
+
addOutput(` Domain: ${data.domain_name}`);
|
| 433 |
+
addOutput(` Registrar: ${data.registrar}`);
|
| 434 |
+
addOutput(` Created: ${data.created}`);
|
| 435 |
+
addOutput(` Expires: ${data.expires}`);
|
| 436 |
+
addOutput(` Name Servers: ${data.name_servers}`);
|
| 437 |
+
} else {
|
| 438 |
+
addOutput(`[!] Error: Could not retrieve domain information`);
|
| 439 |
+
}
|
| 440 |
+
} catch (error) {
|
| 441 |
+
addOutput(`[!] Error: Failed to fetch domain information`);
|
| 442 |
+
}
|
| 443 |
</body>
|
| 444 |
</html>
|