jquery - Lookup DNS using JavaScript and find IPs of particular domain name -


i new in javascript. i'm trying :

<head>     <title>dns check</title>     <script language="javascript" src="dnscheck.js"></script> </head> <body>     <table width="0%" border="0" cellspacing="0" cellpadding="0">         <tr>             <td align="right">domain:</td>             <td align="left">                 <input type="text" id="domaintxt" name="domaintxt">             </td>         </tr>         <tr>             <td align="center">                 <input type="submit" id="submitbtn" value="submit" onclick="dnscheck('domaintxt')">             </td>         </tr>     </table> </body> 

dnscheck.js file:

<script language="javascript" src="/home/dns.js" type="text/javascript">     // dns.js file downloaded  node.js       function dnscheck(domaintxt) {         var dns = require('dns'); // syntax error           dns.resolve4('www.google.com', function(err, addresses) {             if (err) throw err;              console.log('addresses: ' + json.stringify(addresses));              addresses.foreach(function(a) {                 dns.reverse(a, function(err, domains) {                     if (err) {                         throw err;                     }                      console.log('reverse ' + + ': ' + json.stringify(domains));                 });             });         });     } </script> 

but syntax error @ var dns = require('dns');


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -