Advertisement
Guest User

Untitled

a guest
Jan 6th, 2024
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. // Function to perform the nslookup query
  3. function nslookup($domain, $nameserver) {
  4. $cmd = "nslookup -querytype=A $domain $nameserver";
  5. $output = shell_exec($cmd);
  6. return $output;
  7. }
  8.  
  9. // List of domains and nameservers
  10. $domains_nameservers = array(
  11. array('domain' => 'example1.com', 'nameserver' => '8.8.8.8'),
  12. array('domain' => 'example2.com', 'nameserver' => '8.8.4.4'),
  13. array('domain' => 'example3.com', 'nameserver' => '208.67.222.222'),
  14. );
  15.  
  16. // Loop through the domains and nameservers
  17. foreach ($domains_nameservers as $data) {
  18. $domain = $data['domain'];
  19. $nameserver = $data['nameserver'];
  20.  
  21. // Perform the nslookup query
  22. $result = nslookup($domain, $nameserver);
  23.  
  24. // Print the result
  25. echo "Domain: $domain | Nameserver: $nameserver\n";
  26. echo nl2br($result);
  27. echo "\n";
  28. }
  29. ?>
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement